Home  >  Article  >  Web Front-end  >  Basic knowledge of web page production (html) (1) First understanding and attributes of html

Basic knowledge of web page production (html) (1) First understanding and attributes of html

零下一度
零下一度Original
2017-05-05 13:57:361053browse

1: First introduction to html

<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>

Example explanation

Text description between100db36a723c770d327fc0aef2ce13b1 and 73a6ac4ed44ffec12cee46588e518a5e Page

The text between6c04bd5ca3fcae76e30b72ad730ca86d and 36cc49f0c466276486e50c850b7e4956 is visible Page content

The text between4a249f0d628e2318394fd9b75b4636b1 and 473f0a7621bec819994bb5020d29372a is displayed as title

e388a4556c0f65e1904146cc1a846bee and 94b3e26ee717c64999d7867364b1b4a3 The text between is displayed as a paragraph

1.1HTML is a language used to describe web pages.

HTML refers to HyperTextMarkupLanguage

HTML is not a programming language, but a markup language

Markup language is a set of markup tags

HTML uses markup tags to describe web pages

1.2HTML markup tags are often called HTML tags (HTML tag).

HTML tags are keywords surrounded by angle brackets, such as 100db36a723c770d327fc0aef2ce13b1

HTML tags usually appear in pairs, such as a4b561c25d9afb9ac8dc4d70affff419 and < ;/b>

The first tag in the tag pair is the start tag, and the second tag is the end tag

The start and end tags are also called open tags and closing tags

1.3HTML link

HTML link is defined through the 3499910bf9dac5ae3c52d5ede7383485 tag.

<html>
<body>

<a href="http://www.w3school.com.cn">
This is a link</a>

</body>
</html>


Note: Specify the link address in the href attribute.

1.4HTML images

HTML images are defined through the a1f02c36ba31691bcfe87b2722de723b tag.

<html>
<body>

<img src="/i/eg_w3school.gif" width="300" height="120" />

</body>
</html>

Note: The name and dimensions of the image are provided as attributes.

2: html attributes

HTML tags can have attributes. Attributes provide more information about HTML elements.

Attributes always appear in the form of name/value pairs, such as: name="value".

Attributes are always specified in the opening tag of an HTML element.

2.1 Attribute Example

HTML links are defined by the 3499910bf9dac5ae3c52d5ede7383485 tag. The link's address is specified in the href attribute.

More HTML attribute examples

Attribute example 1:

4a249f0d628e2318394fd9b75b4636b1 Defines the beginning of the title.

dfb4d23c807e8ce66d86a7db2dd1cbbb has additional information about alignment.

TIY: Center the title

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"www.php.cn/TR/html4/loose.dtd">

<html>

<body>

<h1 align="center">This is heading 1</h1>

<p>上面的标题在页面中进行了居中排列。上面的标题在页面中进行了居中排列。上面的标题在页面中进行了居中排列。</p>

</body>
</html>

Attribute example 2:

6c04bd5ca3fcae76e30b72ad730ca86d Defines the body of the HTML document.

caf8fd01290d489814c545f9d843d95e has additional information about the background color.

TIY: Background color

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="zh-cn" />
</head>

<body bgcolor="yellow">
<h2>请看: 改变了颜色的背景。</h2>
</body>

</html>

Attribute example 3:

f5d188ed2c074f8b944552db028f98a1 Define HTML table. (You will learn more about HTML tables in a later chapter)

e250a3f15cdd83cbdbae9ebf57168797 has additional information about the table border.

Always enclose attribute values ​​in quotes

Attribute values ​​should always be enclosed in quotes. Double quotes are the most commonly used, but there is no problem using single quotes.

In some individual cases, such as the attribute value itself contains double quotes, you must use single quotes, for example:

name=&#39;Bill "HelloWorld" Gates&#39;

[Related recommendations]

1 . Free html online video tutorial

2. html development manual

3. php.cn original html5 video tutorial

The above is the detailed content of Basic knowledge of web page production (html) (1) First understanding and attributes of html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn