<address> HTML tag is used to provide contact information for the author or owner of a document or an article. This information can include the author’s name, physical address, email address, phone number, and other relevant information. When used correctly, the
<address> tag can help website visitors easily find and contact the author or owner of a website.
Syntax: The syntax for the
<address> tag is simple. You simply need to include the tag within the body of your HTML document, and then include the contact information you want to display within the tag. Here’s an example:
1234 Main St<br>
Anytown, USA 12345<br>
In the above example, we’ve included the name, street address, city, state, zip code, phone number, and email address for the author or owner of the document. We’ve also used the
<br> tag to add line breaks between each line of the address.
<address> tag does not come with any default styling, so you’ll need to apply your own CSS styles to make it look the way you want. Here’s an example of how you might style the
In the above example, we’ve set the font style to italic, and removed any margin or padding that might be applied to the
<address> tag by default.
Best Practices: When using the
<address> tag, it’s important to follow a few best practices:
- Only use the
<address>tag for contact information that is relevant to the author or owner of the document. Don’t use it for other types of contact information, such as customer support or technical support.
- Use the
<address>tag only once per page. Don’t use it multiple times for different pieces of contact information.
- Include only the contact information that is necessary. Don’t include unnecessary information, such as the author’s date of birth or social security number.
- Be consistent in how you format the contact information. For example, if you include a phone number, use the same format throughout the entire address.
In conclusion, the
<address> tag is a simple yet powerful HTML element that can help website visitors easily find and contact the author or owner of a website. By following best practices and styling the tag appropriately, you can make your website more user-friendly and professional-looking.