Ben Godfrey

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.

Comments

Justin Watt http://justinsomnia.org/

Oh no, HTML5 killed your blog!

Cancel

Comments are closed for this post.

Ben Godfrey http://aftnn.org

Yes! Sorry for high level lameness.

Cancel

Comments are closed for this post.

Justin Watt http://justinsomnia.org/

Ha, and apologies on my part for the driveby comment. Not sure if you remember, but you used a photo of mine for your website about your bike ride from HCMC to Phnom Penh:

http://justinsomnia.org/2006/03/cambodia-challenge/

Anyway, I was reminded of that during my recent trip back to Cambodia, when I discovered that a photo of mine was being used in an ad for MekongBank. Crazy coincidence:

http://justinsomnia.org/2011/02/my-photo-smiling-back-at-me/

Cancel

Comments are closed for this post.

Ben Godfrey http://aftnn.org

Hi Justin, I do remember. Your photos has been gracing our site for a fair old time now! Funny about your photo being reused by MekongBank. One of my photos is used in the Wikipedia page on Sacre Coeur. Once used their, they seem to find their way out into lots of places.

Very jealous of your return to Cambodia. Hope you had a lovely time.

Cancel

Comments are closed for this post.

Add a new comment

Comments are closed for this post.