The structure of the HTML language

Source: Internet
Author: User
Tags define end header
An HTML file is a standard ASCII file that looks like a universal text file that adds a number of special strings called Link tags (tag). Structurally, HTML files consist of elements (element), and there are many elements that make up an HTML file, which are used to organize the contents of the file and the output format of the guidance file. The vast majority of elements are "containers", that is, they have start and end tags. The start tag for the element is called the start link sign (start tag), and the element end tag is called the ending link sign (end tag), which is the element body in the start link check and end link signature. Each element has a name and an optional attribute, and the name and attributes of the element are indicated in the initial link sign.
such as body elements (bodies)
<body backgroud= "Back-ground.gif" >
This is the My-i-i-HTML file. <p>
</body>
The first line is the initial link sign of the BODY element, which indicates that the BODY element starts from here. Because all of the link signs have the same structure, we will carefully analyze each part of the link signature so that the reader has a general idea of how to write the link sign.
< starting link check start the BODY element name, because the element and the link sign one by one correspond, so the element name is also called the link signature. Note that there is no space between the < and the body. Element names are not case-insensitive. Background property name. An element can have multiple properties, and the property and its property values are not case-sensitive. This property indicates what method is used to populate the background.
= Indicates property value
The "Background.gif" property value, which indicates that the background is populated with a background.gif file.
Property name, =, the property value is combined to form a complete property, one element can have multiple attributes, and each attribute is separated by a space.
> The start link chain ends.
The second and third lines are the element bodies of the BODY element, and the last line is the end link sign of the element. The end link check starts with </, followed by the element name, then the greater-than >.
From the example above, we can see that there are other elements in the element body of an element. (The heading element Two parts, namely the head element File header
<body> file Body Start
File body
End of </body> file body
It should be noted that HTML is a fast-growing language, and early HTML files do not have such a rigorous structure, so now popular browsers (such as NETSCAPE,MOSAIC, etc.) are also supporting HTML files that are not written in the above structure to maintain compatibility with earlier HTML files. It is also necessary to note that the explanations for HTML elements and their attributes are not exactly the same in various browsers,
The elements in the book, the attributes of the elements and their output are based on the Netscape2.0 browser, and the author will try to give the other browsers an explanation of an element.
Generally speaking, the elements of HTML have the following three representations:
1) < element name > file or hypertext </element name >
2) < element name Attribute name = "attribute value ...> text into hypertext </element name >
3) < element name >
The third type of writing is only used for some special elements, such as subsection element p, which only notifies the WWW browser in this section, and therefore does not need to define the scope of action, so it does not have the end link sign. The htlm3.0 standard also defines the </p> link signature, which is used for paragraphs that need to define the scope of the action, such as the paragraph that increases the alignment attribute.
In HTML files, some elements can only appear in the header element, and most of the elements can only appear in the BODY element. The elements in the header represent general information about the HTML file, such as the file name, whether it can be retrieved, and so on. The order in which these elements are written is irrelevant, and it only indicates that the HTML has or does not have the attribute. In contrast, elements appearing in body elements are order sensitive, and changing the order of elements in an HTML file changes the output of the HTML file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.