HTML <address> Tag

We will explain the Tag Address in this post to assist with the learning requirements.

Contact information for mrexamples.com:

Example

<!DOCTYPE html> <html> <body> <address> Writer <a href="mailto:[email protected]">Colin Smith</a>.<br> Reach us at:<br> mrexamples.com<br> Box 555, virtualland<br> USA </address> </body> </html>

Here is another example of the <address> tag:

Example: 

<!DOCTYPE html> <html> <head> <title>Mr Examples</title> </head> <body> <h3>Our Office Location</h3> <address id="address-1"> <strong>Acme Inc.</strong><br> 27th Floor, XYZ Building<br> 123 Park Avenue<br> New York, NY 10022 <br> Phone: 212-555-5555 </address> </body> </html>

Example Explanation

The above code is an HTML document that contains several elements utilized for structuring and showing content on a website.

  • The first line, “<!DOCTYPE html>“, is a declaration that indicates the HTML5 version used for the document.
  • The root element, “<html>“, encompasses all other elements that compose the document, followed by the “<head>” and “<body>” elements.
  • The “<head>” element contains data about the document, like the title, stylesheets, and scripts, that are not directly visible on the page. In this example, the “<title>” element specifies the title of the page, which displays on the browser’s title bar.
  • The “<body>” element holds the visible content of the page, including text, images, and other media.
  • This example uses the “b” element to create a heading that reads “Our Office Location” and the “<address>” element to display contact information for a company named “Acme Inc.” The “id” attribute assigns a unique identifier to the “<address>” element, which is useful for styling or scripting purposes.
  • Within the “<address>” element, the “<strong>” element is used to make the company name bold.
  • The remaining content within the “<address>” element provides the company’s address and phone number.

Overall, this example showcases how HTML elements can structure and display content on a web page and the role of attributes like “id” in identifying specific elements for scripting or styling objectives.



Uses and Definition

The Tag Address <address> tag displays the contact details for the document’s author or an article.

The contact details may include an email address, URL, physical address, phone number, social media handle, etc when it comes to Tag Address.

The text in the <address> tag is generally displayed in italics, and every browser adds a line break at the start and end of the <address> element.


Browser Compatibility

Element
<address>YesYesYesYesYes

Event Attributes

In HTML, the <address> tag accepts Event Attributes as well.


Global Attributes

In HTML, the <address> tag accepts Global Attributes as well.


CSS Settings By Default

The majority of browsers display the <address> element using the following default values for Tag Address:

address {
display: block;
font-style: italic;
}

Benefits of using HTML <address> Tag

The HTML <address> tag provides several benefits when used correctly in web development. Here are a few benefits:

  1. The <address> tag is a standard HTML tag that provides a consistent and uniform way to display contact information, such as a postal address, email, or phone number.
  2. The <address> tag can be used to provide contact information in a way that is easily identifiable by assistive technology, such as screen readers used by visually impaired users.
  3. Search engines can use the <address> tag to identify contact information and improve the ranking of web pages. This can be particularly beneficial for businesses looking to improve their online presence.
  4. The <address> tag can be styled to match the design of a website, making it easy to integrate into the overall layout and appearance of the page.

If this article somehow helped you to boost your development skills, then do share it with your friends by clicking on the links below.
We value your feedback.
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Subscribe To Our Newsletter
Enter your email to receive a weekly round-up of our best posts. Learn more!
icon

Leave a Reply

Your email address will not be published. Required fields are marked *