HTML and CSS Reference
In-Depth Information
Microformats
Microformats are an effort to extend the expressive power of standard HTML by
using certain attributes, mostly the class attribute, in a standardized way. Pop-
ular microformats include hCard, for describing contact information, adr for ad-
dresses, and hCalendar for describing events. Similar technologies include the
more formal RDFa and HTML5's own microdata (see section 2.5.3).
The main goal of microformats is to render common information like
events easily parseable by computers without affecting the end-user
presentation.
Microformats enable a number of useful applications: search
engines that can tell you about nearby upcoming events and
browsers that can automatically add the events to your calendar.
Addresses, being naturally plain text information with some internal
structure (house number, street name, city, and so on) are relatively
easy to deal with, as long as there's some way to demarcate the compo-
nents. Microformats manage this by adding a class of location to the
containing element, or alternatively using another microformat, adr, to
describe the address in detail. Dates and times are more complicated.
Take the simple example 1/6/2011. If you're reading this in the United
States, you probably interpret that as January 6, whereas in the UK
the date is 1st June. Or have another look at the earlier BBC example:
the date is “today.” I took that screenshot some time ago—how useful
is “today” now? You may think this is no more or less ambiguous than
the addresses, but the frustrating thing is that we know that an abso-
lute date and time underlie the more ambiguous human expression that
we see more commonly.
Computers like dates and times in an unambiguous format.
People often find the unambiguous format hard to digest but
can easily understand ambiguous dates from the context. To
serve both, web pages need to provide dates in two formats.
Search WWH ::




Custom Search