What is the <address> Tag?
The <address> HTML tag is used to provide contact information for the author or owner of a document or article on a webpage. This tag helps organize contact information, making it accessible and structured for both users and search engines.
Basic Syntax of the <address> Tag
<address>
Written by John Doe.<br>
Visit us at:
Example.com
1234 Example Ave.
City, Country
Phone: (123) 456-7890
</address>
In this example, the <address> tag wraps the contact information, making it easy to identify for browsers and screen readers. The tag may include an individual’s or organization’s contact details, such as address, phone number, and website link.
Attributes of the <address> Tag
The <address> tag does not have specific attributes but can include HTML elements such as <a> for email addresses or links, <br> for line breaks, and <p> for paragraph formatting. Here’s an example:
<address>
Contact us at: <a href="mailto:info@example.com">info@example.com</a><br>
Phone: (123) 456-7890<br>
Address: 1234 Example Ave., City, Country
</address>
Best Practices for Using the <address> Tag
- Use It Only for Contact Information: Reserve the
<address>tag for genuine contact information like physical address, phone numbers, and email addresses. - Combine with Links: Use the
<a>tag within<address>for clickable email addresses or website URLs. - Place at the Bottom of the Page: Typically,
<address>is placed in the footer, but it can also appear near author bios or contact sections.
Example: Using <address> in a Footer
Below is an example of how you might use the <address> tag in a website footer:
<footer>
<address>
Contact us: <a href="mailto:contact@example.com">contact@example.com</a> | (123) 456-7890<br>
Address: 1234 Example Ave., City, Country
</address>
</footer>
Conclusion
The <address> tag is an essential element for adding structured contact information to your website. It enhances accessibility and provides clear, organized details, making it easier for visitors to reach you.
0 Comments