Amptools.Net

simplify your life.

Archive for February, 2010

Microformats in HTML 5

No Gravatar

Declaring microformat uri profiles in HTML 5 is different than it was for HTML 4. The profile attribute for the head element was dropped in HTML 5. Gone. Banished, despite the use of other W3 standards that might make use of it like GRDDL (Gleaning Resource Descriptions from Dialects of Languages). And I though Microsoft was bad at naming things..

This is the typical way that you would define a uri profile in HTML 4

<html profile="http://purl.org/uF/2008/03/">

In HTML 5, the microformat’s wiki suggests using a visible link, anchor a element, or a hidden link inside the head element. I suggest we use the hidden link inside the head element, despite the lack of example usage of this on the wiki.

<link rel="profile" href="http://purl.org/uF/2008/03/" />

Now you can go out in the world still use microformats for HTML 5 without generating invalid markup.