Forum Moderators: open

Message Too Old, No Replies

Address element question

"Best" way to show an address in XHTML

         

bofe

5:14 pm on Jan 6, 2004 (gmt 0)

10+ Year Member



There's the tag <address>, but here's what I'm wanting.

Line 1: Office Name, Name of building ¦ University Name ¦ P. O. Box #
Line 2: City, State ZIP
Line 3: Phone: ****-xxx-xxxx ¦ Fax: xxx-xxx-xxxx

Should I not put the phone and fax inside of <address>

and, is it acceptable to put <br /> (i'm using XHTML) tags inside of <address>

Thanks :)

tedster

2:27 am on Jan 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The W3C says, on many pages: "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."

That seems to include fax and phone, I'd say. And <br /> is allowed within, I'm almost 100% sure. When in doubt, try the validator.

However, note that <address> was "supposed" to be contact information for the document, and not to be used addresses in general. Of course, almost no one ever understood that. There's some discussion on the W3C lists about this relative to the next version of XHTML.

bofe

3:25 am on Jan 7, 2004 (gmt 0)

10+ Year Member



Thank you, sir.

I always have difficulty reading W3C specs/docs, so I like the more "english" answers at WebmasterWorld.

Thank you, though.

It's valid. But I have recently been bitten by the "spelling is not grammar" semantics end of things.

Thanks again

IeuanJ

9:14 am on Jan 7, 2004 (gmt 0)

10+ Year Member



Hi, both the use of <br /> and <p> </p> are perfectly valid within the <address> </address> tag.

Although symantically both are not really true reflections there are no better ways to achieve what you want adn these are both standards compliant.

Some people also format it as a list

<address>
<ul>
<li>Address Line 1</li>
<li>Address line 2</li>
</ul>
</address>

But I think lists are overused anyway so shy away from that method, besides I normaly put addresses on one line myself.

There has been an amount of discussion lately about a new tag to define lines that would make more sense semantically but thats way in the future yet.

IeuanJ

9:16 am on Jan 7, 2004 (gmt 0)

10+ Year Member



Oh and as mentioned, yes ALL contact info should go inside the <address> tags.

Name
Land Address
PO Box
Fax
Phone
Mobile
Email Address
Carrier Pigeon Name
.......