Skip to content Skip to sidebar Skip to footer

Don't Use
For Address

Here is what the HTML5 spec says: The address element represents the contact information […] The address element must not be used to represent arbitrary addresses […] Isn't

Solution 1:

Hum... when you quote the specs, don't remove the relevant parts (emphasis is mine):

The address element represents the contact information for its nearest article or body element ancestor.

The address element must not be used to represent arbitrary addresses (e.g. postal addresses), unless those addresses are in fact the relevant contact information.

As I understand this :

The address element must not be used to represent arbitrary addresses (e.g. postal addresses), unless those addresses are in fact the relevant contact information for the nearest article or body element ancestor.

Is it still unclear ?

Regarding company address in footer : it is ok to use the <address> tag if the nearest article or body element ancestor is about the company.

You must use the <p> tag for addresses that are not related to the nearest article or body element ancestor.

Solution 2:

The basic markup for postal addresses is a p element with br elements for separating the lines.

The address element conveys additional information, namely, that this postal address is (part of) the contact information for an article (if there is one) or the body (if there is no parent article).

So in both cases you should have the same markup for postal addresses, either with or without address container (depending on the purpose of the postal address).

In your specific example (company address in the footer of the company’s website), you should use the address element, because your company is the relevant contact for the webpage. Note that this address could also contain your company’s email address, telephone number etc.

Why the element is named address instead of contacts?

Probably because the element name was adopted from previous non-HTML specifications (and maybe its purpose/meaning was redefined at some point discussing HTML). On Early History of HTML it says in the "Pre-1990: GMLguide and GML" section that the "Waterloo SCRIPT GML User's Guide" (some kind of predecessor to SGML) from 1988 mentions several tags that are now used in HTML, too, and among them is ADDRESS.

But it doesn’t really matter. While descriptive element names are helpful, they are not required. The semantics are defined by the HTML specification, not by the element names.

Looking at the various HTML versions, we can see that it was never intended to be used for every kind of postal address:

Post a Comment for "Don't Use
For Address"