The structure of the HTML language

Source: Internet
Author: User

The structure of the HTML language
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)

Demo

This is the My-i-i-HTML file.

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 is checked in.
From the example above, we can see that there are other elements in the element body of an element. (The title element of the second row in the previous example

&hellip;
and the segmented element of the third row
. In fact, an HTML file consists of only one HTML element, the file begins with the end, and the part of the file is the element body of the HTML. The element body of an HTML element is made up of
two parts, the header element ... and body elements ... and some comments. The element body of the head element and the BODY element is composed of other elements and text and annotations.    In other words, an HTML file should have the following structure:
HTML file start
File header start
Header
File header end
File body start
File body
file body End
HTML file End
It should be noted that HTML is a fast-growing language, and that early HTML files do not have such a strict structure, so now popular browsers (such as NETSCAPE,MOSAIC, etc.) to maintain compatibility with earlier HTML files, HTML files that are not written according to the above structure are also supported. It is also necessary to note that the interpretation of HTML elements and their attributes is not exactly the same for various browsers, and the elements in this
book, the attributes of the elements and their outputs are based on the Netscape2.0 browser, and the author will try to give the other browsers an explanation of an element.
    Generally, HTML elements have the following three representations:
1 < element name > file or hypertext </element name
   2) < element name Attribute name = "Genus Sex value ...> text into hypertext </element name
    3) < element name
    The third way of writing is only for special elements, such as piecewise element P, It simply notifies the WWW browser to dispose of this paragraph, so it does not need to define the scope of the action, so it does not have a trailing link sign. The htlm3.0 standard also defines the

Link signing, which is used for paragraphs that need to define a scope, such as a paragraph that increases the alignment attributes.
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.