Open In App

HTML <address> Tag

Improve
Improve
Like Article
Like
Save
Share
Report

The HTML <address> tag defines contact information for the author or owner of a webpage. it can contain various contact details such as an email address, URL, physical address, mobile number, social media, etc. The text inside the <address> tag will be displayed in italic format. Some browsers add a line break before and after the address element.

Note: The <address> tag also supports the Global Attributes and Event Attributes in HTML.

HTML address Tag syntax: 

<address> Address... </address>

HTML address Tag Usage :

  • Use <address> for showing details like organization name, website, and contact info.
  • Employ this tag to credit the writer of an article, making it clear who created it.
  • Drop <address> tag in the footer to share essential details about the site or author on every page.

HTML address Tag Example:

Here, we will see the implementation of the address tag with an example.

html




<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8">
    <meta name="viewport" 
          content="width=device-width, 
                   initial-scale=1.0">
    <title>HTML <address> tag</title>
</head>
  
<body>
    <!-- address tag starts from here -->
    <address>
        Organization Name: GeeksforGeeks <br>
        Web Site:
        <a href=
            GeeksforGeeks
        </a>
        <br>
        visit us:
        <br>
        GeeksforGeeks
        <br>
        710-B, Advant Navis Business Park, 
        <br>
        Sector-142, Noida Uttar Pradesh – 201305
    </address>
    <!-- address tag ends here -->
</body>
  
</html>


Output: 

HTML address Tag Example Ooutput

HTML address Tag Example Explanation:

Here is the implementation explanation of the above example.

  • Here we creates HTML document with a <head> section containing metadata and a <body> section for content.
  • Inside the <body>, the <address> tag defines contact information for “GeeksforGeeks”.
  • The <address> includes organization name, website link, and physical address.
  • The rendered output shows the contact information enclosed within the <address> tag, including the organization name, website link, and physical address.

HTML address Tag Example:

Here The <address> tag employs global attributes like id and class, along with the event handler onclick to trigger an alert.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8">
    <meta name="viewport" 
          content="width=device-width, 
                   initial-scale=1.0">
    <title>HTML <address> tag</title>
</head>
  
<body>
    <!-- address tag starts from here -->
    <address id="organizationInfo" 
             class="organization" 
             onclick="showDetails()">
        Organization Name: GeeksforGeeks <br>
        Web Site:
        <a href=
            GeeksforGeeks
        </a><br>
        visit us:<br>
        GeeksforGeeks<br>
        710-B, Advant Navis Business Park,<br>
        Sector-142, Noida Uttar Pradesh – 201305
    </address>
  
    <script>
        function showDetails() {
            alert("Contact details clicked!");
        }
    </script>
</body>
  
</html>


Output:

HTML address Tag Example Output

HTML address Tag Example Explanation:

Here is the implementation explanation of the above example.

  • The <address> tag contains organization information like name, website link, and physical address.
  • It has an id and class attribute for identification and styling.
  • An onclick event triggers a JavaScript function, showDetails(), which displays an alert.
  • The webpage displays organization details and triggers an alert when the address is clicked.

HTML address Tag Use Cases:

1. How to write address in an HTML document ?

To write an address in an HTML document, enclose it within the <address> element, typically used for contact information or citations.

2. How to markup postal address in HTML ?

To markup a postal address in HTML, enclose it within the <address> element, and use appropriate tags like <p>, <span>, and <br>.

HTML address Tag Supported Browsers:

The browser supported by HTML address tag are listed below:

  • Google Chrome 1
  • Edge 12
  • Firefox 1
  • Opera 15
  • Safari 1


Last Updated : 19 Feb, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads