[whatwg] HTML5 DOCTYPE suggestion

Toby A Inkster mail at tobyinkster.co.uk
Sat Feb 21 13:48:49 PST 2009


Michael Ball wrote:

 > <!DOCTYPE HTML5>

Although HTML 5 consciously breaks away from HTML's SGML legacy, in  
SGML terms, the first component of a document type declaration (i.e.  
the first thing after "!DOCTYPE") defines the document's root element  
name. So if you used "<!DOCTYPE HTML5>" then SGML tools would expect  
the document to be wrapped in "<html5>...</html5>" tags instead of  
"<html>...</html>".

In HTML 4, it's technically possible to use elements other than  
<html> as the root element. See this example:

	http://examples.tobyinkster.co.uk/div.html

Of course, browsers don't do strict SGML parsing, so the above  
document is actually parsed as if it had <html> and <body> elements  
wrapping it.

-- 
Toby A Inkster
<mailto:mail at tobyinkster.co.uk>
<http://tobyinkster.co.uk>






More information about the whatwg mailing list