Moving to HTML5

HTML5 book

I’ve converted this site to HTML5. It took about 5 minutes.

The first step was to switch the doctype. The HTML5 doctype:

<!DOCTYPE html>

And that’s it. No more secret incantation.

The 2nd step was to remove the trailing slashes from void tags (<img>, <meta>, <br>, etc). These are optional in HTML5. I’m not using the XML serialisation, so they’re unnecessary.

Next steps

When I get another 5 minutes, I’d like to use the new document structure tags - <header>, <nav>, <section>, <article> and <footer>. These expose the semantics of the document more clearly (useful for authors). They can also be styled with display:block to keep older browsers happy. Their introduction was based on a large-scale analysis of HTML document structure performed by Google.