Joseph Scott

Minimum HTML 5 Document

with 3 comments

Dustin Diaz recently posted about skinny doctypes, which basically boiled down to:

<!doctype html>

Folks in the comments pointed out that this is the doctype that HTML 5 uses. I’d only been glancing at HTML 5 from time to time, but this got me to look at it a little bit closer. I went to the W3C Validator to see what the minimum HTML 5 document looked like. Here’s the smallest document that still validated:

<!doctype html>
<html>
<head>
    <title></title>
</head>
<body>

</body>
</html>

Now this is what I’m talking about, simple and to the point.

The validator does give one warning for this document, but it’s simply to mention that HTML 5 conformance is still experimental.

Written by Joseph Scott

December 2nd, 2008 at 9:00 am

Tagged with

3 Responses to 'Minimum HTML 5 Document'

Subscribe to comments with RSS or TrackBack to 'Minimum HTML 5 Document'.

  1. That’s untrue: the html, head, and body elements all have optional start and end tags. The shortest valid document is:

    <doctype html><title></title>

    • Nice catch, that does pass as valid HTML5. That might be a little too minimal though :-)

  2. Geoffrey, that’s a fun test and all :) But basically the point was that we can actively and confidently use [!doctype html]

    Dustin Diaz

    2 Dec 08 at 1:35 pm

Leave a Reply