Correct use of the address element

Discussion in 'HTML' started by JJ, Feb 27, 2011.

  1. JJ

    JJ Guest

    According to the spec (
    http://www.w3.org/TR/html401/struct/global.html#h-7.5.6 ), "The ADDRESS
    element may be used by authors to supply contact information for a
    document or a major part of a document such as a form." Yet I've seen
    numerous examples, even in books, of the address element being used to
    mark up addresses in the more everyday sense of any brick-and-mortar
    location, as in:

    <address>
    John Smith<br />
    1234 Rolling Rock Rd. <br />
    Albany, NY, 12345<br />
    </address>

    (From Pro CSS Techniques, Apress 2006).

    So suppose I was creating a "contact us" page which included the
    physical address of an organisation - in that case, should the address
    element be used? If not, which element would be most appropriate?
     
    JJ, Feb 27, 2011
    #1
    1. Advertising

  2. Sherm Pendley wrote:

    >> <address>
    >> John Smith<br />
    >> 1234 Rolling Rock Rd. <br />
    >> Albany, NY, 12345<br />
    >> </address>

    >
    > I don't view such usage as contradictory to the spec; it's certainly
    > contact info, assuming one wants to contact the document authors via
    > snailmail.


    It is certainly contact info, but is it conteact information for the
    document (the specific web page) or a major part thereof? Did John Smith
    create the document?

    >> So suppose I was creating a "contact us" page which included the
    >> physical address of an organisation - in that case, should the
    >> address element be used?

    >
    > I would use it for that, certainly.


    At the logical and semantic level, the question is not what type of
    information the <address> element contains - it might be a postal address,
    an email address, a phone number, or something else - but whose address it
    contains. So here the question really is what John Smith has with the page
    to do.

    On the practical side, why would you use <address> elements in borderline
    cases, or at all? If you expect software to pay attention to defined
    <address> _semantics_, then the element content should answer the question
    "How can I contract the person(s) who created this page or substantially
    added to its content?" If you are interested in rendering, then <address> is
    more of a problem than a solution, because it is often rendered in italics,
    which is an awful idea but mentioned in W3C documents as typical rendering.
    This is not serious if you know it - just add
    address { font-style: normal; }
    plus any special formatting you prefer.

    For a postal address other than the author's address, you can use <div> or
    <p> (with class, probably). HTML 4 describes <p> as paragraph, and so do the
    HTML 5 drafts, but they go wild and described almost any chunk of text that
    does not contain block elements as "paragraph". Because a postal address is
    not a paragraph in any normal sense, <div> is the HTML 4 way and <p> is the
    HTML 5 way. The practical difference is small as long as you remember that
    <p> elements have default top and bottom margins, <div> elements don't.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Feb 27, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. joon
    Replies:
    1
    Views:
    532
    Roedy Green
    Jul 8, 2003
  2. Dan

    correct or not correct?

    Dan, Oct 2, 2003, in forum: HTML
    Replies:
    7
    Views:
    465
  3. HANM
    Replies:
    2
    Views:
    762
    Joseph Kesselman
    Jan 29, 2008
  4. candide
    Replies:
    65
    Views:
    1,450
  5. John Koleszar

    address of static array element as address constant

    John Koleszar, Jul 7, 2008, in forum: C Programming
    Replies:
    7
    Views:
    644
    John Koleszar
    Jul 15, 2008
Loading...

Share This Page