A few facts about our favorite HTML, which are hidden by the authorities are rarely mentioned in textbooks and manuals. Perhaps for many it is obvious platitudes, but someone they can seem amusing, someone - useful. Plus, some of abstract thinking about. Inspired by this topic, although the idea matured much earlier.
Objections to the merits, and even moderate holivor in the commentary to fully welcome!
HTML does not allow “overlap” tags (like <a> <b> </ a> </ b>)
In this elementary check with a validator. Although many of the old articles advocating XHTML, you can run into the converse. Perhaps, the authors casually read the specification XHTML1.0 (or can read only the colored text:).
None of the adopted version of HTML was never tag <nobr>, <wbr>, <marquee> and <blink>
Try to disprove a link to the resp. specification, if you can:)
It is reasonable to ask “how then this trash come from?”. Good question …;)
HTML 4.01 Strict stricter (in terms of separation between content and presentation) than XHTML 1.0 Transitional
It is from HTML 4.01 Strict (more accurately, more of the HTML 4.0 Strict) were removed presentational tags like <s>, <u> and <font>, as well as attributes such as align (legacy HTML 3.x). A XHTML 1.0 completely took over the entire set of tags and attributes relevant subversions HTML 4.01, only changing the syntax. Therefore, in XHTML 1.0 Transitional this whole “presentation garbage” left.
HTML does not allow “not to close items”
The fact that the HTML closing (and for the 4 elements - and the opening) tags are optional, does not mean that the relevant elements can be “not close” (and, accordingly, “not open”). Just for closure (opening) of this element is somewhat equal and equally correct syntaxes. And it is not browser-independent activity (as with the first two facts) - a documented feature of the language of SGML, which is based on the HTML version of the second quarter, inclusive.
Rules of the closure elements in the HTML is really more complicated than XML, so heavier parsers (real browsers do not even take up a full SGML-parsing, replacing it with a simplified algorithm tightly sewn up in HTML5 this situation myself, this algorithm is legalized). Still, these rules are clearly defined and unambiguous. Therefore, in the HTML page can not be done without the BODY element or a table without TBODY - a required element appears in its rightful place when parsing regardless of the tag. While in XHTML in XML-parsing can easily construct a DOM, where tr is embedded directly in the table (and it validate correctly!). But where more order?
The foregoing is not an appeal “not to close the tags. But knowledge of this feature can be great help in debugging (one example I have given in the topic for about optional tags).
Limit slash in single tags in HTML means something quite different from that in X (HT) ML
“Samozakrytye” tags in XML (such <br/>) come from a little-known features SGML called «Null End Tags (NET)». And if the XML uniquely determines their value, in the SGML (and, therefore, in HTML4 - in theory) they can be interpreted in two ways. NET has a slash in the closing tag (eg, <title> text </ title> can be reduced to <title / text /), so the entire structure <br/> interpreted as a closed tag line break, followed by the symbol “>”. By the way, that’s how these tags understands HTML-validator - only, perhaps, practically significant application that uses an honest SGML-parsing of DTD (see the example, note the sections «Source Listing» and «Document Outline» below).
It turns out that for HTML-XHTML-compatible markup, we should be grateful browsers … that they do not fully support SGML (and, accordingly, HTML:)! That’s because as it happens.
HTML is not easier for a man than XML, and can hardly be called a “language for the lazy”
Evidence, I hope, above enough:). Instead of once remember (you can even mechanically, like a mantra, not understanding:) a very brief set of not-so-complex syntactic constraints must be constantly aware of the peculiarities of each individual tag credit default when parsing and rendering.
Why such a complicated and confusing HTML not been superseded by a simple and clear, XHTML? Because it is resistant to errors. The reason for that is not necessarily Krivorukov webmaster, especially in our sverhdinamichno-ayaksovoe time.
HTML 5 wins against markup languages, in my view, largely because it saves the robustness (which users are unlikely to give up convenience for developers:), but greatly simplifies the parsing compared with SGML-monsters (on the same basis to the best of many years of browser-based practice).
HTML 5 - today «HTML by default”:)
This paradoxical, but the logical conclusion to be drawn. Since browsers do not support all the standard rules for previous versions of HTML, ignoring the DTD and use doktayp for other purposes, and the rules for the new standard are drawn from their actual behavior - it turns out, the new standard for them “closer to the body” rather than formal action! Again, doktayp for HTML5 does not contain the version number and serves only to activate the standard mode. And for application / xhtml + xml browsers (who knows it) does not require doktaype and understand all the tags and attributes (including deprecated) - which is strange from the standpoint of XHTML1.x, but it is quite logical for XHTML5.
Of course, the abuse of “credit default” has not yet adopted a standard should not be (a reason as Ian Hickson terrified developers obviously taken from the ceiling, the date “2022″ - hasty in such matters as the long-awaited introduction of order in all HTML-nom kingdom, predicts nothing good). But, in my opinion, it is periodically glances at this dynamic is a draft. At least for that in the future have fewer surprises, such as those described in this topic:).
Check out the analysis of
hankyung.com,
englishtown.com,
kharkov.ua,
affaritaliani.it,
state.il.us,
cheapstingybargains.com,
pornprosnetwork.com,
wwwamnc1.com,
allday.ru,
rightmove.co.uk - and much more