Basic structure of 1html

Source: Internet
Author: User

<!DOCTYPE HTML><HTML>    <Head>        <MetaCharSet= "UTF-8">        <title></title>    </Head>    <Body>    </Body></HTML> 

All browsers support infrastructure tags

First, <! Doctype> declaring document specification types

1, must be the first line of the HTML document, located before the

The DOCTYPE is a shorthand for document type (documents);

is not an HTML tag; it is a directive that instructs the Web browser to write which HTML version of the page to use;

No end tag;

Insensitive to casing.

2, the role.

By default, the standard browser and IE are not the same resolution standard, different browser resolution model (document.compatmode) is different,if the declaration standard, the browser is not compatible.

Alert (Document.compatmode)://backcompat: Weird mode, the browser uses its own weird mode to parse the rendered page. Css1compat: Standard mode, browser uses the standard resolution rendering page.

no DOCTYPE declaration, compatmode default is Backcompat, different browsers will show different styles;   

If there is a DOCTYPE declaration, open Standard mode, the browser will be in accordance with the standards of the Web to parse rendering page.

3. Grammar

HTML top-level element Availability "registration//organization//Type label//Definition Language" "URL"

-Top-level element: Specifies the top-level element type declared in the DTD. This corresponds to the declared SGML document type. HTML default. Html.
-Availability: Specifies whether an official public identifier (FPI) is a publicly accessible object or a system resource. Public default. Objects that are publicly accessible. system resources, such as local files or URLs.
-Registration: Specifies whether the organization is registered by the International Organization for Standardization (ISO). + Default. The organization name is registered.
-The organization name is not registered. The Internet Engineering Task Force (IETF) and the World Wide Web Association (WWW) are not registered ISO organizations.
-Organization: Designation indicates responsibility by! DOCTYPE declares the name of the group or organization that references the creation and maintenance of the DTD, namely Ownderid. IETF IETF. .
-type: Specifies the public text class, which is the object type being referenced. DTD default. Dtd.
-Tags: Specifies the public text description, which is a unique descriptive name for the referenced public text. The version number can be attached later. HTML default. Html.
-Definition: Specifies the document type definition.
Frameset the frameset document.
Strict excludes all the representative attributes and elements that all the experts want to phase out because the stylesheet is well-established.
Transitional contains all the contents except for the FrameSet element.
-language: Specifies the public text language, which is the natural language encoding system used to create the referenced object. The language definition has been written as an ISO 639 language code (uppercase two letters). EN default. English.
-URL: Specifies the location of the referenced object

4. Type

There are 3 types of DTD (document type definition) declarations in XHTML 1.0 that can be selected: transitional (Transitional), Strict (Strict), and Frame (Frameset).

1. Transition: Requirements are not strictly allowed to use HTML4.01 's identity in the page (conforming to the XHTML syntax Standard), as follows:

<! DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">

2. Strict: requirements strictly not allowed to use any of the performance layer of the logo and attributes, such as <br/>, etc., the following wording:

<! DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd " >

3. Frame: specifically for frame pages, this DTD is used when the page contains frame elements, as follows:

<! DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd ">

Using a strict DTD to make a page is, of course, the ideal way. However, for web designers who do not have an in-depth understanding of web standards, it is more appropriate to use a transitional DTD. Because this DTD also allows the use of the identity, elements, and attributes of the presentation layer, it is more appropriate for most web authoring staff.

5. Differences

In HTML 4.01, <! The doctype> declaration requires a reference to the DTD, because HTML 4.01 is based on SGML (Standard generalized Markup Language standardized Universal Markup Language) that prescribes three (Strict, transitional, and Fr Ameset) a different statement. The DTD specifies the rules of the markup language to ensure that the browser renders the content correctly. HTML5 is not SGML-based, so reference DTDs are not required. Only one of the following is specified in HTML5:

<! DOCTYPE HTML >

Second,

This element tells the browser that it is itself an HTML document.

Note: Even if the HTML element is the root element of the document, it does not contain the DOCTYPE element. The DOCTYPE element must precede the HTML element.

The xmlns attribute is required in XHTML, but not in HTML. However, even if the

Third,

Defines the head of the document, which is the container for all head elements.

You can reference the script, instruct the browser where to find the style sheet, provide meta information, and so on.

The

The header of the document describes various properties and information about the document, including the title of the document, its location in the Web, and its relationship to other documents. Most of the data contained in the header of a document is not actually displayed to the reader as content.

The following tabs are available in the Head section <base><meta><script><style><title>.

Iv. <body></body>

The BODY element defines the body of the document.

The BODY element contains all the contents of the document, such as text, hyperlinks, images, tables, lists, and so on. )

Wu, <meta charset= "UTF-8" >

Character Set (CharSet): is a collection of overall general characters for a system aid. Characters are all kinds of words and symbols, including national degrees of text, punctuation, graphic symbols, numbers and so on.

When we do the Web page, if the designated Charset is GB2312, then should not appear in the Web page of traditional characters, because the GB2312 standard only thousands of Simplified Chinese characters. If our page encoding is UTF-8, we do not specify that the character set is GB2312, because although the UTF-8 encoding corresponds to a UTF-8 character set that contains GB2312 characters, the same character has a different number in the two character set. The following encoding methods, such as: Chinese GBK, Traditional Chinese Big5, each language encoding method is different, so need to use CharSet for the page to provide a way to encode, otherwise the page is likely garbled. "UTF-8" is an international character encoding, which is independent of any language and can be used in any language.

Using UTF8 encoding (internationalized encoding)
<http-equiv= "Content-type"  content= "text/html; Charset=utf-8"  />
Use Chinese GBK encoding
<http-equiv= "Content-type"  content= "text/html; CHARSET=GBK" />
Use Simplified Chinese GB18030 encoding
<http-equiv= "Content-type"  content= "text/html; charset= GB18030 "/>
Use in xhml/html
<charset= "UTF-8"/><charset= " GBK "/><charset=" gb18030 "/>

Six, <title></title>

Defines the title of the document. The browser uses the caption in a special way, and usually places it in the title bar or status bar of the browser window. Similarly, when a document is added to a user's list of links or favorites or bookmarks, the title becomes the default name for the link to the document. The <title> tag is the only thing in the

Be sure to choose the right title, which is important for defining the document and ensuring that it is available for effective use on the Web.

Keep in mind that users can access every document in a document set in any order and independently. Therefore, the title of the document should not only be defined according to the context of other documents, but also show its own characteristics. Headings that contain document reference sorting are usually not good headings. For example, headings such as "the 16th chapter" or "Part five" are useless for readers to understand their content. A more descriptive title, such as "the 16th Chapter: HTML title", or "part five: How to use the title", the title not only expresses its position in a large document set, but also explains the specific contents of the document, attracting readers more interest in reading.

The title of self-reference is also of little use. Headings like "Home page" have nothing to do with content, like "feedback pages" or "Common links". You should design a title that conveys a certain content and purpose so that the reader can determine whether it is necessary to access the page by this title. "HTML <title> Tag Details", this is a descriptive title, similar to "HTML <title> tag Feedback page" and so on.

People often spend a lot of time creating Web documents, but they are often wasted simply because of a non-appealing or meaningless title. When special software that automatically collects links for users becomes more and more popular on the web, only the title of the page will be inserted into the large linked database as a descriptive word related to the page. So, how do we emphasize that this is not excessive: Please carefully select a descriptive, practical, and context-independent for each of your documents.

Basic structure of 1html

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.