I was reading a book about HTML and there is a paragraph I wasn't able to understand:
If you have use lots of legacy stuff from back in the 2.0 and 3.2 days of HTML. Then use HTML 4.01 Transitional DOCTYPE, which allows you to validate your pages but still permit some of legacy HTML. So, that you don’t have to rework all your HTML to get it to validate.
My question is What is th开发者_Python百科e meaning of the above paragraph and
What’s the difference between Transitional and Strict DOCTYPE of HTML?
Strict is closer to the designers' ideal for HTML 4. Transitional includes additional obsolete stuff that has been mostly replaced by CSS.
Another thing to keep in mind, in addition to the doctypes' intrinsic differences, is that the HTML 4 Transitional doctype is the only modern (by that, I mean HTML versions 4 and up) doctype that triggers quirks mode 1 (this is bad!); all others trigger standards mode rendering.
1 See the source. Also, please note that it's a little more complicated; the transitional doctype triggers quirks mode when it has no system identifier, and standards mode when it does. You really should be using HTML 4.01 strict, or better still, HTML 5.
In STRICT doctype you have to refer to and only to the HTML standard you define. Older rules are deprecated and thus validation will fail if they are broken.
If you have old HTML formatted documents and do not want to change them to conform to the new rules, then you are allowed to use to some extend both new and old rules, using transitional HTML.
The doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that the browsers render the content correctly.
Please go through these sites to educate yourself - http://www.w3schools.com/tags/tag_doctype.asp, http://htmlhelp.com/tools/validator/doctype.html, http://www.w3.org/QA/2002/04/valid-dtd-list.html
精彩评论