5

What is the best method to code physical address in html ? in Semantic, Accessible and SEO way

Pascal Cuoq
  • 79,187
  • 7
  • 161
  • 281
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852

2 Answers2

11

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">info@commerce.net</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
  • 38,786
  • 23
  • 141
  • 206
-3

<address> is exactly what you are looking for.

http://www.w3.org/TR/html401/struct/global.html#h-7.5.6

Boris Guéry
  • 47,316
  • 8
  • 52
  • 87
  • 2
    `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 Dec 11 '09 at 10:05
  • 1
    The W3C specifications : >The ADDRESS element may be used by authors to supply contact information for a document It 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 Dec 11 '09 at 10:12
  • 2
    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 Dec 11 '09 at 10:13