TML 5 is an interesting beastie. The specification was not planned; The W3C was committed to HTML 4.1 as the last word in HTML. As such, most of the requests for HTML 5 came from the HTML user community itself, largely through the advent of the Web Hypertext Application Technology Working Group (WHATWG). The push from WHATWG was strong enough to prompt the formation of a HTML 5 working group a couple of years ago. Since then, the HTML 5 working group has slowly gone through the process of taking a somewhat hand-waving specification and recasting it in W3C terms, along with all the politics that the process entails.
On April 23, 2009, the HTML 5 group released the most recent draft of the specification. Overall, it represents a considerable simplification from the previous release, especially as a number of initially proposed changes to the specification have been scaled back. The group defined roles for the proposed changes elsewhere.
HTML 5 is a broad specification, and consequently, dozens of distinct changes?more than a single article can reasonably cover in any detail?occurred between HTML 4 and 5. This article focuses on the HTML 5 layout elements. Subsequent articles will examine forms-related changes (which are substantial), the new media elements, and DOM-related changes.
One of the most significant changes in HTML 5 is that both the HTML and XHTML formats are recognized as legitimate expressions of the specification. This is a major change that has among its implications the requirement for browsers to recognize fully the XHTML version of the syntax (this currently is not the case with Internet Explorer, for instance). This also means that all browsers should recognize application/xhtml+xml or application/xml as legitimate mime-types for encoding HTML documents. The HTML document DocType has also undergone some revisions. The long doctype of HTML 4 has been replaced with the far shorter :
This is an example document
This represents the continued “de-SGMLification” of HTML, which has been underway for a number of years. While this shortened doctype construct is still legitimate SGML, the heavy SGML trappings of previous years are disappearing in favor of the simplified XML interface.
HTML 5 also recognizes SVG and MathML as additional valid formats within even HTML documents. Such instances do not necessarily need to incorporate namespaces in HTML, although they are of course required in XHTML.
Layout Element Changes
Beyond the media elements (which will be deployed in the upcoming Firefox 3.5 implementation), a number of the new elements introduced into HTML 5 are intended to establish structure or divisions on the page.
Two of the biggest mistakes made in the original HTML specification were not having a formal containment model for sections?content is simply a linear narrative with the occasional header rather than sections within sections?and reserving the
One consequence of the latter mistake was that it prohibited the use of a generic
However, the use of the
- Make things such as automatic generation of meaningful tables of content far easier.
- Make it generally simpler to lay out content in meaningful ways.
- Make storing subordinate content within web pages for later inclusion more efficient, as you need only store the articles rather than the whole page.
HTML 5 includes aelement that can hold subordinate , , etc. elements. This at least ameliorates one of the trickier problems involved with layout: providing a semantically consistent way of creating subtitles, especially at different levels in a document. For instance, take the following snippet:
An Overview of HTML 5
Looking at Spec Changes
This is the first paragraph.
This is the second paragraph.
Laying out the markup
This is the subsection P1...
This markup shifts the h1 tag from a single document-level tag to something bound to the scope of its container, whether article or section. Usingalso makes it easier to put together tables of content. As HTML becomes more widely used for purposes other than simple browser display, changes like this should serve to make the language sufficiently flexible for print or other media organization.