Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Correct use of the address element

Reply
Thread Tools

Correct use of the address element

 
 
JJ
Guest
Posts: n/a
 
      02-27-2011
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?
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-27-2011
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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
address of static array element as address constant John Koleszar C Programming 7 07-15-2008 03:51 PM
Address of an array = address of its 1st element: undecidable question? candide C Programming 65 05-29-2008 08:30 PM
how to Update/insert an xml element's text----> (<element>text</element>) HANM XML 2 01-29-2008 03:31 PM
correct or not correct? Dan HTML 7 10-02-2003 10:16 PM
To correct my program. please, check to find errors and correct me. joon Java 1 07-08-2003 06:13 AM



Advertisments