Tìm Kiếm
News - Events
Products

HTML 5 review

Posted at: MONday - 28/06/2010 09:24
I have to say that my money used to be on XHTML 2.0 eventually winning the battle for the next great web standard. Either that, or the two titans would continue to battle it out for the forseable future, leading to an increasingly fragmented web.
HTML 5 review

HTML 5 review

But now that the W3C has admitted defeat, and abandoned XHTML 2.0, there’s now no getting away from the fact that HTML 5 is the future. As such, I’ve now spent some time taking a look at this emerging standard, and hope you’ll endulge my ego by taking a glance over my thoughts on the matter.

Before I get started though, I have to say that I’m very impressed by what I’ve seen. It’s a good set of standards that are being created, and I hope that they will gradually be adopted over the next few years.

New markup

HTML 5 introduces some new markup elements to encourage better structure within documents. The most important of these is <section>, which is used to define a hierarchy within a document. Sections can be nested to define subsections, and each section can be broken up into <header> and <footer> areas.

The important thing about this addition is that it removes the previous dependancy on <h1>, <h2> and related tags to define structure. Within each <section>, the top level heading is always <h1>. You can use as many <h1> tags as you like within your content, so long as they are correctly nested within <section> tags.

There’s a plethora of other new tags, all of which seem pretty useful. The best thing about all of this, however, is that there’s no reason not to start using them right away. There’s a small piece of JavaScript that’s needed to make Internet Explorer behave, but aside from that it’s all good. More details about this hack are available at http://www.diveintohtml5.org

Easier media embedding

HTML 5 defines some new tags that will make it a lot easier to embed video and audio into pages. In the same way that images are embedded using <img> tags, so now can video and audio files be embedded using <video> and <audio>.

I don’t think than anyone is going to complain about these new features. They free us from relying on third-party plugins, such as Adobe Flash, for such simple activities such as playing video.

Unfortunately, due to some annoying licensing conditions and a lack of support for the open-source Theora codec, actually using these tags at the moment requires that videos are encoded in two different formats. Even then, you’ll still need to still provide an Adobe Flash fallback for Internet Explorer.

You’ll need to be pretty devoted to HTML 5 to use these tags yet…

Relaxed markup rules

This is one thorny subject. You know how we’ve all been so good recently with our well-formed XHTML, quoting those attributes and closing those tags? Now there’s no need to, apparently…

On the surface, this seems like a big step backwards into the bad days of tag soup. However, if you dig deeper, the reasoning behind this decision goes something like this:

  1. It’s unnacceptable to crash out an entire HTML page