A simple declaration of regression in HTML5 __html

Source: Internet
Author: User
Tags deprecated

By default, Firefox browsers and IE browsers are not the same interpretation standards. If a page does not declare DOCTYPE, it interprets the following HTML or XHTML with the default DOCTYPE. Under the same standard, different browser models have differences in interpretation, if the declaration criteria are different, do not need me to say, you can do it yourself. Learn Web standards, browser compatibility, where to start your own decision, however, please know DOCTYPE: <! doctype> definition

* DOCTYPE is a shorthand for document type, which tells the browser which HTML or XHTML specification is used for the document;

* Does not belong to HTML or XHTML tags, is a declaration, does not need to be closed;

* Must be in the first line of an HTML or XHTML document

* Not case sensitive

* All browsers support <! Doctype> statement

<! Doctype> usage<! DOCTYPE html
Public "-//W3C//DTD XHTML 1.0 strict//en"
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
The above code, the first line: declares that the root element of the document is HTML, and the second line is defined in a DTD defined as "-//W3C//DTD XHTML 1.0 strict//en" in the public identifier, and the browser will understand how to find the third line of DTDs that matches this common identifier: if the browser Does not match the identifier in the second row, the browser uses the URL following the public identifier as the location to look for the DTDwhat is a DTD. DTDs are called document type definitions, and DTDs specify rules for markup languages so that the browser can render content correctly.
There are several types of DTDs. * Transition (Transitional): A very loose DTD that allows you to continue using HTML4.01 's identity (but to conform to XHTML), the complete code is as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

* Strict (Strict): Requires a strict DTD, you can not use any of the presentation layer of the identity and attributes, such as &LT;BR&GT, the complete code is as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >

* Framework (Frameset): A DTD specifically designed for frames page design, if your page contains frames, you need to use this DTD, complete code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 frameset//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd" >
Common DOCTYPE Statements* HTML 5
<! DOCTYPE html>
* HTML 4.01 Strict
The DTD contains all HTML elements and attributes, but does not include display and deprecated elements such as font. Frameset (framesets) is not allowed.
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD" >
* HTML 4.01 Transitional The DTD contains all the HTML elements and attributes, including the displayed and deprecated elements (such as font). Frameset (framesets) is not allowed.
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >

* HTML 4.01 Frameset
The DTD is equivalent to HTML 4.01 transitional, but allows frameset content.
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 frameset//en" "HTTP://WWW.W3.ORG/TR/HTML4/FRAMESET.DTD" >

* XHTML 1.0 Strict
The DTD contains all HTML elements and attributes, but does not include display and deprecated elements such as font. Frameset (framesets) is not allowed. tags must be written in well-formed XML.
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >

* XHTML 1.0 Transitional
The DTD contains all the HTML elements and attributes, including the displayed and deprecated elements (such as font). Frameset (framesets) is not allowed. tags must be written in well-formed XML.
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

* XHTML 1.0 Frameset The DTD is equivalent to XHTML 1.0 Transitional, but allows frameset content.
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 frameset//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd" >

* XHTML 1.1
The DTD is equivalent to the XHTML 1.0 Strict, but allows the addition of models (for example, to provide Ruby support for East Asian languages).
<! DOCTYPE HTML PUBLIC "-//w3c//dtd XHTML 1.1//en" "Http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >HTML5 statement why so simple. There are three kinds of <! in HTML 4.01 Doctype> statement. Only one of the HTML5: <! DOCTYPE Html&gt, what is this for? The DOCTYPE in HTML 4.01 needs to refer to DTDs because HTML 4.01 is based on SGML. While HTML 5 is not based on SGML, it does not require references to DTDs, but requires DOCTYPE to regulate the behavior of browsers.
The statement in HTML5 is actually a regression, a simple way of declaring.



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.