Forum Moderators: open
I have read that the words inside an <address> tag are italicized. Does this mean that what is in the <p> tag will also be italicized? Is there a way to un-italicize what is in the address tag, both what is in the <p> tag and the address itself that is not in the <p> tag but within the <address> tag?
address {font-style: italic;} address {font-style: normal; font-weight: normal; text-align: left;}
address p {further-details-here} The address element represents the contact information for its nearest article or body element ancestor. If that is the body element, then the contact information applies to the document as a whole.
<snip>
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. (The p element is the appropriate element for marking up postal addresses in general.)
The address element must not contain information other than contact information.
<snip>
Typically, the address element would be included along with other information in a footer element.
Address, though? Really? I just recently finished weeding out my own <address> elements on grounds of being just too 1997.
would a visitor be able to click on the phone number and dial the number on a smartphone, or do you need responsive website design to do this? Also, will what I have written appear okay if the site is viewed on a desktop? Will Call (111) 234-5678 today. appear as plain text or a link? Will there be any display problems in terms of maybe the sentence not showing up at all on a desktop?
Can each line of the address be put inside a <line> tag? Is there such a thing?
What the bleep is <line>? I can't even find it!
But what's the reason for the mishmosh of <p> <line> and <br> within the address?
you might want to consider using structured markup for the address.
[edited by: gouri at 2:50 am (utc) on Dec 1, 2013]
If I was using the <br /> tag within a <p> tag, would I need to leave a space?
<p>blahblah<br />
moreblahblah</p> when you use:
XYZ Company<br />
123 Pine Drive<br />
City, State 11111<br />
Machine will read it as:
XYZ Company123 Pine DriveCity, State 11111
XYZ Company<br />123 Pine Drive<br />City, State 11111<br /> Space characters must be rendered as horizontal white space. In HTML, multiple spaces should be rendered as proportionally larger spaces.
Typically, an address element is italic and/or right justified or indented. The address element implies a paragraph break. Paragraph marks within the address element do not cause extra white space to be inserted.
Are you positive about this?
In as much as one day I saw
would I be able to use HTML tags such as <header> and <footer>?
Would you say that it is easier to code using <address> than using structured markup? I guess what I am asking is I am not very familiar with structured markup. Would it be hard to learn?
Also, do you think that structured markup in some way help with higher rankings in the SERP than using the <address> tag? Maybe for local searches?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
would I be able to use HTML tags such as <header> and <footer>?
while the anchor text would show as a link, the tel: protocol typically won't work on a desktop.
i would suggest using an identifiable span element for that text and use some javascript to change it to an anchor element for smartphone visitors.
If you serve it as xml (which you should), some of your visitors (all with a decent browser), will see "invalid markup" messages instead of your intended content.
[I've not actually tested that in practice to be honest - but it should]
Just use HTML5. Despite your doctype, that's what browsers are actually using to display your page anyway.You can use that doctype and serve application/xhtml+xml just fine. XHTML is NOT dead and used quite a bit by sites that use XML in the background. I just ran across one large popular site (which of course escapes me right now) that does just that.
XHTML is NOT dead and used quite a bit by sites that use XML in the background. There are tons of documents around marked up in XML so serving them as XHTML makes a lot of sense.
you could put the phone number in a span element or other container that displays it as plain text and it gets replaced by a clickable/callable anchor element using the same phone number text for smartphone visitors.
Just use HTML5. Despite your doctype, that's what browsers are actually using to display your page anyway.