HTML <address> Address Tag
The <address>
tag in HTML is used to define contact information related to the author or owner of a document, article, or a specific section of content. Typically, it contains details like physical addresses, email addresses, phone numbers, or links to social media profiles.
Syntax:
<address>
Contact Information
</address>
Usage and Context:
- The
<address>
tag is intended for contact details only, not for representing a geographical address on its own. - It is commonly used in the footer of a webpage or alongside an article to provide information about the content creator or organization.
Example:
<address>
Written by <a href="mailto:someone@example.com">John Doe</a>.<br>
Visit us at:<br>
Example Inc.<br>
1234 Main St.<br>
Anytown, USA
</address>
In this example:
- The
<address>
tag wraps contact information, including an email link, company name, and physical address. - The contact information appears formatted with line breaks for clarity.
Display:
The <address>
tag typically renders the content in italic by default in most browsers and applies block-level formatting, meaning it starts on a new line and spans the full width available.
Use Cases:
- Author's Contact Information: If a webpage or an article needs to show who authored the content and how to contact them.
- Company Information: Businesses can display their contact information, including address, email, and phone numbers.
- Footer Section: It is often used in the footer of a website to display the website owner's contact details.
Example for Footer:
<footer>
<address>
Contact us at <a href="mailto:info@example.com">info@example.com</a>.<br>
1234 Example Ave, Suite 100<br>
City, Country 56789
</address>
</footer>
Misuse Warning:
The <address>
tag should only be used for contact information. It is not meant for geographical addresses in a broader context (like a map location) or to display random text.