Now that the web standards ‘battle’ is being won, and web developers are taking more care with their markup, a regular question is “should I use the address tag?“. This questions comes in various guises, but the fundamental problem is that the address
element doesn’t have the meaning that people assume it does.
On Webaim, the questions was is it good for accessibility. Having discussed this on Evolt before (and been slightly wrong, so read up on it), I jumped in:
Is the address tag good for accessibility?
I would say it’s fairly ambivalent at the moment with regards to accessibility. Not harmful, but not useful either.
With regards to ‘should I use it?’, I would split this into three questions:
- Is there anything useful about address tags for accessibility in the
specs? (No.) - Do any current user agents do anything special with it? (Not that I
know of.) - Is there any likely future use? (Unlikely.)
For questions one and two: It is a tag with a confusing past, which has lead to it being used in different ways, and User-Agents not making any use of it.
The address tag would seem appropriate for the type of uses that Microformats are for, such as being able to copy contact information from a web page straight into your addressbook.
The reason I don’t think it is likely to be much use in future is that:
- Microformats don’t use
address
for marking up addresses. - HTML 5 doesn’t specify it as general contact information markup.
- Neither does XHTML 2.
HTML 4.01, HTML 5 & XHTML 2 define it as contact information for the document or section of a document.
Since that isn’t the use that most people consider it for (marking up general contact information), it is unlikely to be utilised by User Agents for contact information. The address element is likely to be trapped in a spiral of non-use.
Personally, I’d go with microformats.
What next?
The question about address
is literally an FAQ, and it will keep recurring if things don’t change. Even a simplebits quiz didn’t really resolve it. From what the Webaim poster said, it is already being mis-used (at least in terms of the current spec):
A (CMS) page that I recently inherited is mostly italics because it is a contact page and the author used address tags not just for the address itself but also for names, e-mails, phone numbers and fax numbers (presumably on the grounds that they are all addresses in a contact context).
Unfortunately not that many people are going to ask, they will just use it on the assumption that it is for any contact information.
I don’t think it would be realistic to suggest changing the meaning of address
now, but is there something else people could be referred to in future?
I haven’t found a better element in HTML 5 or XHTML 2 for the purpose that authors are using at the moment, currently they specify for contact information for the document, not the organisation.
Therefore I can only see two options:
- Tell people that
address
is only for contact information for the document, and the best you can do for general contact information is mark them up with hcard. - Add a new element, something more generic for contact information. Perhaps a block level
contact
element?
The first is annoying, the second unlikely. Still, might be worth asking about regarding the future of HTML.
Technorati Tags:
The choice ist not hCard or address. The html elements (or tags) are bejond the scope of microformats. And hCard goes very well with address. Marking up an address container with class=”vcard” and putting general (or not so general) contact information into this container is an optimal way to include this contact information in a web page.
Additionally it is possible to further refine the role of the contact information container, independent of if this container is an adderess container or a div or whatever. Setting the class to vcard specifies this container to not only contain general contact information, but special contact information formatted according to the hCard specification. And f.ex. with Dublin Core it would be possible to further specify the role of that contact information (DC.creator, DC.contributor, DC.publisher) (see also: http://www.rorkvell.de/tech/dc).
The suggestion to eliminate the address tag is no good idea. Just because it is rarely used does not imply that it is useless. It offers an option, which should be kept.
Your right that
address
and hcard are not mutually exclusive. However, my point is that if you useaddress
for contact information other than that of the document author, you are wrong (according to current and proposed specs).I believe that it why Microformats don’t use it, because that would be misleading. (I’m fairly sure that is Tantec’s opinion.)
Therefore any functionality that user-agents implemented to take advantage of the element would conflict with it’s current use.
Oh, and by deprecate, I didn’t mean eliminate, just not recommend for general usage any more.
Are you sure that address is only specified for contact information for the pages author? Not for a pages contributor, publisher ore anything else related to that page? Only the author?
just from the w3c:
(emphasis added by me)
Which bit was that from? The part I would refer to is the HTML spec:
HTML 5 is very similar (as you would expect from being backwards compatible), and makes it more explicit:
XHTML 2 replicates the HTML 4.01 wording.
It is also the number 1 FAQ on hCards, which concludes:
I agree that it wasn’t very specific in the HTML spec, but the meaning that people writing specs have given it since is quite clear.
That is quite a good indicator of what would be implemented (or not) in browsers & user-agents.
I’m just saying that there is a divide between what web developers think it is for, and what the spec & browser people think it’s for.
My position is to loosen it’s meaning for HTML5. The meanings of other elements are being adjusted to better reflect common usage, and using
<address>
for marking up any sort of contact information would be more useful in practise. Since UAs don’t do anything special with it yet, maybe that would find some traction and the change would be made.Address wasn’t one of the top
class
values so it’s difficult to find figures for what people are currently using for contact information.However, just about every website I visit has a contact page with details that are relevant beyond that section of that page. The only time I see
<address>
being used as specified in HTML4 is on W3C pages and Apache documentation…which is hardly common.Since making the semantics less restrictive would still keep it compatible with existing UAs, I think that’s a feasible option.
If you hadn’t seen it, I put my idea for loosening
<address>
to WHATWG in Should<address>
be more general-purpose? on their forums. Zcorpan, Hixie and Lachy all commented on it but nothing has been decided yet. 🙂Go throw your two penneth in if you’ve ideas for this element!