The specifications for HTML 5 define elements of the language in terms of the operation and effects of the document's internal object model, making HTML 5 more of an abstract language than earlier versions. As a result, the language can be encoded in more than one syntax, as determined by the media type (text/html for the HTML syntax or application/xhtml+xml for the XML syntax, for example). Documents can even exist without an external representation through using the DOM APIs internally.
HTML pages on the web have been somewhat haphazardly created under various different standards and proprietary formats and in many cases with no particular standard or format in mind. As a result, different browser vendors have developed a variety of incompatible methods of handling a lot of non-standard and just plain bad HTML coding.
For backward compatibility with the majority of existing documents, the HTML 5 specification requires document parsers and viewers (browsers) to support older, deprecated elements and attributes and other non-standard HTML coding in as consistent manner as possible. This means that HTML 5 compliant user agents will gracefully handle some of the more common errors in HTML coding. It's sort of a "Do What I Mean, Not What I Say" feature of web browsers. It also means that different browsers should start handling certain types of errors in the coding of HTML documents in a more consistent and predictable way.
In layman's terms, there are two different branches of the HTML standard - one for HTML authors and another for developers of browsers and other HTML parsers. While browsers may recognize deprecated and non-standard HTML coding, developers creating new HTML pages should avoid deprecated HTML elements and attributes and try to create documents that conform to the authoring requirements of the HTML 5 standard. The benefits of conforming to the HTML authoring standard include more consistent presentation among traditional web browsers, better support in handheld and mobile devices and greatly increased longevity of the HTML pages being created.
One of the most significant new features of HTML 5 is the ability to mark up sections of an HTML document using the sectioning tags and related tags, which can identify types of content within a section such as headers, footers and sidebars displayed along with a web page.
true, false or an empty string.
<option selected="selected"/>
The following ways of coding HTML attributes should be avoided:
<option selected/>
<option selected=""/>
<option selected="true"/>
<option selected="yes"/>
| Style vs. Semantics |
|---|
|
|
<link media="print" .../>
while a version for small screen devices such as cell phones
would be indicated by <link media="handheld" .../>.
class attribute
are also case-sensitive.
match="img"). The template would use
<xsl:output method="html" omit-xml-declaration="yes"/>
to convert the document to true HTML, by removing extraneous
closing tags, for example. That is, coding in the source document
such as <img src="..." alt="..."></img> would
automatically become <img src="..." alt="..."> with
no closing </img> tag or self-closing />.
<html xmlns="http://www.w3.org/1999/xhtml">).
Therefore, template matching rules would include a prefix for the namespace
(ex: match="html:img" xmlns:html="http://www.w3.org/1999/xhtml").
Last updated Friday September 11, 2009
Printer-friendly PDF* format:
Differences Between HTML 5 and Earlier Versions
You are currently viewing this page in XHTML 1 Style Sheet* format (* see Clicklets for more infomation). This document is also available in XHTML 1*XML*HTML 4*HTML 5 Style Sheet*HTML 5 XML*HTML 5 non-XML* XHTML 2* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.