What is the best method to code physical address in html ? in Semantic, Accessible and SEO way
+7
A:
Use a Microformats vCard
<div class="vcard">
<span class="fn">Gregory Peck</span>
<a class="org url" href="http://www.commerce.net/">CommerceNet</a>
<div class="adr">
<span class="type">Work</span>:
<div class="street-address">169 University Avenue</div>
<span class="locality">Palo Alto</span>,
<abbr class="region" title="California">CA</abbr>
<span class="postal-code">94301</span>
<div class="country-name">USA</div>
</div>
<div class="tel">
<span class="type">Work</span> +1-650-289-4040
</div>
<div class="tel">
<span class="type">Fax</span> +1-650-289-4041
</div>
<div>Email:
<span class="email">[email protected]</span>
</div>
</div>
Accesible: √
Semantic: I guess..
SEO: √ Google announces support for microformats
More examples at http://microformats.org/wiki/hcard-examples
Also check out the Oomph Microformats toolkit that helps you displaying and consuming microformats.
Eduardo Molteni
2009-12-11 09:48:45
Do we need to write css for all classes in my CSS file? and in vcard where i can put company name? and what is the benefit of formatting like this ?
metal-gear-solid
2009-12-11 09:55:26
You don't need to add all the classes, only the ones that will help you displaying it in a nice way.
Eduardo Molteni
2009-12-11 09:56:08
@Jitendra No. Classes are not required to have a specified style.
deceze
2009-12-11 09:57:04
I think i will go for id in the onces that are not general.
Colour Blend
2009-12-11 10:09:08
+1 it seems best answer till now but i still have some confusion , in vcard where i can put company name? and what is the benefit of formatting like this ?
metal-gear-solid
2009-12-11 10:10:07
this code makes us classitis
metal-gear-solid
2009-12-11 10:10:42
Use `fn` class in any element for the name, and `org` class for the company. You can put them together if you are showing a company address.
Eduardo Molteni
2009-12-11 10:18:19
The benefits: http://microformats.org/wiki/benefits
Jonny Haynes
2009-12-11 12:01:24
is there any tool to make this code quickly?
metal-gear-solid
2009-12-13 09:38:18
The mentioned Oomph toolkit has a tool to make them quickly
Eduardo Molteni
2009-12-13 13:36:07
`address` is **not** exactly what you are looking for. `address` is intended only to mark up contact info regarding the currently viewd page (like the Apache 404 default error pages and the "Apache X.X at ..." line.
Boldewyn
2009-12-11 10:05:15
The W3C specifications : >The ADDRESS element may be used by authors to supply contact information for a documentIt is not 'intended only'. I think the most important part is 'supply contact information', and it's what you should want when you provide an address. So it look semanticly correct to use `address` in those cases.
Boris Guéry
2009-12-11 10:12:03
from HTML 5 Spec: The ´address´ element must not be used to represent arbitrary addresses (e.g. postal addresses), unless those addresses are in fact the relevant contact information. http://dev.w3.org/html5/spec/Overview.html#the-address-element
Eduardo Molteni
2009-12-11 10:13:01