HTML: <address> tag
This HTML tutorial explains how to use the HTML element called the <address> tag with syntax and examples.
Description
The HTML <address> tag defines contact information for the nearest <article> or <body> ancestor in the HTML document. Browsers traditionally render the text found within the <address> tag as italicized text. This tag is also commonly referred to as the <address> element.
Syntax
In HTML, the syntax for the <address> tag is:
<body>
<address>
You can contact us at:<br>
TechOnTheNet.com<br>
123 Somewhere St.<br>
City, State
</address>
</body>
Sample Output
Attributes
Only the Global Attributes apply to the <address> tag. There are no attributes that are specific to the <address> tag.
Note
- The HTML <address> element is found within the <body> tag.
- The <address> tag provides contact information for the nearest <body> ancestor in HTML 4.01.
- The <address> tag provides contact information for the nearest <article> or <body> ancestor in HTML5.
- The <address> tag is generally placed within the <footer>, for the <article> or <body>.
- Do not place the publication date within the <address> tag, instead use the <time> tag.
- For IE browsers older than IE 9, use HTML5shiv which is a javascript workaround to provide support for the new HTML5 elements such as: <header>, <main>, <article>, <section>, <aside>, <nav>, <footer>.
- Most browsers will render the text within the <address> tag as italicized text but you can change this behavior with CSS.
Browser Compatibility
The <address> tag has basic support with the following browsers:
- Chrome
- Android
- Firefox (Gecko)
- Firefox Mobile (Gecko)
- Internet Explorer (IE)
- Edge Mobile
- Opera
- Opera Mobile
- Safari (WebKit)
- Safari Mobile
Example
We will discuss the <address> tag below, exploring examples of how to use the <address> tag in HTML5, HTML 4.01 Transitional, XHTML 1.0 Transitional, XHTML 1.0 Strict, and XHTML 1.1.
Advertisements