by matt
14. August 2007 15:00
Just when you thought you knew HTML, they've gone and announced HTML 5.
It looks like they're running with some of the Semantic Web ideas, and have added elements specifically designed to give semantic meaning to parts of a web page. My particular favourite is the <time> element. I've wanted something like this for ages. Currently, when you put a time on a web page, the reader generally has no idea when it is. E.g. what time is 9.50? Is that AM? What time zone? Similarly, is 01/02/2007 February 1st (of course it is) or the 2nd of January? And look at all those blog posts, every one of them with a date and time on them.
Anyway, the <time> element wraps around a bit of text (such as "Sunday") and in the attributes can provide an exact date, time and time zone. The only downside is that there isn't a recommended rendering for the element. Indeed, the browser should probably just render the content of the element, so perhaps the actual date and time (preferably translated to local time) would be available as a tooltip? But that's not very discoverable, is it?
Interestingly, this won't break compatibility with existing browsers because a downlevel browser will ignore the element and just render the content.
But the real question is, why do we need this? The microformats movement have been embedding semantic meaning into web pages via the use of CSS class attributes for ages. Take a look at this example:
<abbr class="dtstart" title="20070501">May 1st 2007</abbr>. Does exactly the same as the <time> element. There's a good comment further down that page that claims this is bad for accessibility reasons - screen readers will read out the title attribute of the abbreviation element for clarity. But then it's easily fixed by simply using a <span> element.
So, HTML5 and Microformats. Which is Betamax, and which is VHS?
3628cbb7-1689-4206-9020-189bd4423dfe|0|.0
Tags: