Why does HTML5 not omit the standard type declaration directly! Doctype? -

Source: Internet
Author: User
Why didn't HTML5, which has always paid attention to conciseness, be omitted here? All input is & lt ;! Doctypehtml & gt; why didn't simple HTML5 be omitted?
All input isReply: it is a headache to see HTML5.
This is too broad in the industry.

I don't know if you're talking about it in a broad or narrow sense.

That's Fan.
After all, when I pull my shit, does the claw machine give me a random answer?

The existence of doctype is only a historical reason
From HTML to XHTML
You need a bird to show UA whether it's a hair.
No HTML
XHTML uses pubicID and systemID to determine whether UA needs to be processed in strict XHTML mode.
But UA is not a bird.
It only distinguishes how to render details based on this stuff.
That is, the so-called
Standard Rendering
Almost standard Rendering
Weird Rendering
Three Types

To HTML5
There are basically no birds in XHTML.
Doctype can actually be used
But UA recognizes this
HTML (4) Compatibility
If you go to HTML5 rendering, you won't be able to reverse the history.

Total of major manufacturers in whatwg
Haha
I am lucky.
UA implementation in determining doctype
At the end, both publicID and systemID do not exist.
When there is only one doctype html left
We all put this back to the standard rendering mode.

Teay
Leave a light pole doctype for html5.
Perfect compatibility

Bytes
The reality is that there are actually many sets of browser standards. w3c is recognized as a standard, and some browsers have their own standards. Do not write the document type, The browser will break you down!
The browser actually only looks at it! DOCTYPE
It doesn't matter what is written later. The subject follows w3c standards, but the implementations of various browsers are slightly different in details, and your syntax is even non-standard, it will also be automatically corrected to the standard syntax you do not write, how does the browser Know That You Are html5, you can still omit to omit, but the difference is, after omitting, the browser may have different views on page rendering. Just like giving him a variable name followed by his value, the browser just needs to check the variable name, you will be able to know what the document type is. Read HTML5 design principles. So today, there may not be so many garbled characters that need to be processed.
Therefore, although the conventions are greater than the configuration, proper configuration can avoid too much trouble.
Now, HTML5 is confident and unified throughout the world. What about ten years later? There will certainly be more technical updates.

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.