SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Best Semantics for an Address

    What is the best HTML semantics to use for an Address on a contact page?

    ACME, Inc.
    1450 Desert Drive
    Box #25
    Phoenix, AZ 85004
    (480) 555-1212

    1.) Should I use one <p> for the whole address?

    2.) Should I use a <p> for each line in the address?

    3.) Should I use a <li> for each line, and an <ul> for the Address as a whole?

    4.) Possibly a <dt> and <dd>?


    The address needs to larger font since it is on a "Contact Us" page, and really the only thing on the page. (Maybe it could even be an <h2>?!)

    Thanks,



    Debbie

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,606
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    I've seen all of those techniques used at one time or another. The choice usually has to do with the developer's coding style and existing CSS code.

    Additionally, there's also the <address> tag
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I use the <address> tag, but that's technically not what it's for. Luckily, no user agent gives a rat's : )

    <address> was intended to display information, such as a name, url, and/or email address, of the person who posted/wrote the information. Since this was designed back in the heady days of BulletinBoards, think plain text mailing-list imitation where one university sends a document to another university.

    So I figure, meh: if it's the postal address of the one who owns the site (and therefore created the content), why not.

    I use it like so
    <address>
    first line <br>
    second line <br>
    ... <br>
    last line</address>

    If you're listing multiple postal addresses (more than 2), each address likely belongs in a li within a ul.

    Whether you use a br or CSS to make newlines depends on whether the newlines are considered part of the address, which might mean the format the user needs.

    If I'm writing an address that explains to a user how to send us a mail, I use the br's, because this is what the post office expects, and so the multi-line format is necessary information... especially when it's an address that is foreign to the visitors.

    3.) Should I use a <li> for each line, and an <ul> for the Address as a whole?
    No. Each line can't stand alone as its own item. It means nothing without the other parts of the address, whereas a list such as a list of links (like a menu), each link can work and be viewed fine on its own.

    4.) Possibly a <dt> and <dd>?
    If you supplied dt's, though for most visitors those would be redundant:
    ...
    <dt>Company name: </dt>
    <dd>Foo Corp</dd>
    <dt>Street Address: </dt>
    <dd>123 Foo Lane</dd>
    <dt>Postcode, City: </dt>
    <dd>3333AA Fooburg</dd>
    <dt>Country: </dt>
    <dd>Foolandia</dd>
    <dt>Telefoon: </dt>
    <dd> 1234567890</dd>
    ...


    The address needs to larger font since it is on a "Contact Us" page, and really the only thing on the page. (Maybe it could even be an <h2>?!)
    If it's not heading other content, I wouldn't make it a header, no matter how important it is. The h1 (or whatever you're using as main page header) would say "contact" or "contact information" so the address underneath is plain content being headed... just make it bigger with CSS.

  4. #4
    SitePoint Zealot FaridHadi's Avatar
    Join Date
    Nov 2008
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might also want to look into Microformats. Here's how the suggest you markup your address: adr Microformats Wiki


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •