hCard implementation
The address is imlemented using the html
address
element as
container, which is
exactly for what this element was designed for. A shortened
example then might look like:
address class="vcard"
span class="fn"
Siegfried Gipp/span
span class="street-address"
Grundstr. 66/span
span
span class="postal-code"
64385/span
span class="locality"
Reichelsheim/span
/span
/address
To visually format that example to look like you expect an address to look like, and as it looks like in my about me page, you need a simple small piece of css:
address span, address a.email, address a.url { display: list-item; list-style-type: none; } address span.postal-code, address span.locality { display: inline; }
Better would be this style:
address > span { display: list-item; list-style-type: none; }
Unfortunately, at least as far as i know, the Internet Explorer does
not know tho handle this. The advantage of this would be, that only
direct child elements of address
are formatted as list-item. Elements further down in hierarchy would
be formatted as normal, as inline. This may come in handy if you
for example do not have the full name (fn), but instead have
a separate given name and family name:
address class="vcard"
span class="fn"
span class="given-name"
Siegfried/span
span class="family-name"
Gipp/span
/span
span class="street-address"
Grundstr. 66/span
span
span class="postal-code"
64385/span
span class="locality"
Reichelsheim/span
/span
/address
If this should look good for IE too, then you would have to add something to the above style:
address span, address a.email, address a.url { display: list-item; list-style-type: none; } address span.postal-code, address span.locality, address span.given-name, address span.family-name { display: inline; }
The advantage of this markup is, that it is not only human readable, but also machine readable. Combined with the autodiscovery technics it would be possible to automatically get the address data of a person just by knowing the homepage url.
It should be notet that this address recovery would be possible for address harvesters, too, and so could be misused for spamming easily. But since the publication of these addresses is necessary (in some countries enforced by law), you already need to find other protection against spam.
With a Firefox extension it is possible to export these hCard address data to a VCard file.