- Home
- /
- Tutorials
- /
- HTML Tutorial
- /
- HTML <address> Tag
HTML Tags
HTML <address> Tag
The address tag holds contact details for the person or organization behind a page or an article: an email, a phone number, a link, a postal address. Its name is misleading, because it is not for just any address.
The rule is: <address> belongs to its nearest <article>, or to the whole page if it is not inside one. In a blog post it is the author's contact details; in the site footer it is the company's. A list of shop locations or a delivery address in a form is not what it is for; use normal paragraphs there.
Syntax
html
<address>
Contact information goes here
</address>There are no special attributes, only the global ones such as class, id, style and title.
Example
html
<!DOCTYPE html>
<html>
<head>
<title>Address Tag Example</title>
<style>
address {
font-style: italic;
background-color: #f8f9fa;
border-left: 4px solid #29AB87;
padding: 10px 15px;
width: fit-content;
}
</style>
</head>
<body>
<h1>HTML <address> Tag Example</h1>
<p>For more information, contact us at:</p>
<address id="contact-info" class="office-address" style="color:#2c3e50;">
<strong>HTML5 and CSS3 Organization</strong><br>
45, Tech Park Road, New Delhi - 110001<br>
Email: <a href="mailto:info@html5andcss3.org">info@html5andcss3.org</a><br>
Website: <a href="https://html5andcss3.org" target="_blank">https://html5andcss3.org</a><br>
Phone: +91-9876543210
</address>
</body>
</html>The contact block shows the organization name in bold, the street address, a clickable email link and website link, and a phone number. Browsers display <address> in italics by default; this example also adds a light background and a green left border.
Good habits
- Use
<br>for line breaks inside a postal address, as in the example. Each line on its own is not a paragraph. - Make contact details useful:
<a href="mailto:...">for email and<a href="tel:+91...">for phone numbers, so readers can tap them on a phone. See HTML Email Links. - Only put contact information inside
<address>. A publication date, for example, belongs in a<time>tag outside it. - The italic style is just a default. Remove it with
address { font-style: normal; }if it does not suit your design.
Browser Support
Chrome | Edge | Firefox | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| Yes | Yes | Yes | Yes | Yes | Yes |
HTML <address> Tag exercises
Add contact details
Mark up this contact detail of the page with the element made for it: hello@example.com
Result
