Part 1 of a few.

It seems that everyone has started talking about HTML5. I’ve recently converted sfsfw.org (still a work in progress) to HTML5 (ditto) and built a microsite at work in the language.

So, what parts of the brave new world am I embracing?

The new doctype

<!DOCTYPE html>, well that will save a few bytes per page. I’ve never tried to type a doctype from memory before, I’ve always cut and pasted from another project or from an authoritative source, but now I might just type it, saving a few seconds. I can’t help feeling that the lack of versioning information is a making a problem for the future (and let’s not get into the related area of all the things that HTML doctypes do/mean in comparison with what SGML or XML doctypes are meant to mean…).

The new character encoding

<meta charset="utf-8" />, again that will save a few bytes on those pages where I bother to include a meta tag rather than just trusting to the HTTP header (and I know why the belt and braces approach is useful, so long as they both tell the same story).

The new block level elements

<section>, <article>, <header>, <footer>, <aside> and <nav>. These are rather cool. Not immediataly earth shaking but they make code cleaner and debugging easier – less often will I be staring at </div></div></div></div> and wondering whether my current problem is caused by having too few or too many closing div tags.

The new input types

number, tel, email, url are already being used in several forms on visitlondon.com and it makes me smile ‘cos me and a handful of other Opera users get to see the benefit right now. I think these will be my favourite part of the new spec for some time to come.

There’s a lot more to HTML5. This isn’t meant to be a tutorial, just some personal observations and use cases. I’ll try to delve a bit deeper into how I’m using these pieces of code and why I’m using these but not others in future posts.

Tags: ,

No Comments

  1. Steve Pugh says:

    How come the stylesheet on this blog makes <code> indistinguishable from regular text? Bugger.

Leave a Comment


(will not be published unless you behave like a spammer or a troll)