HTML <address> Tag
Last Updated :
19 Feb, 2024
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 >
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 >
</ body >
</ html >
|
Output:Â
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 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 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:
To write an address in an HTML document, enclose it within the <address> element, typically used for contact information or citations.
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
Share your thoughts in the comments
Please Login to comment...