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: w3wiki < br > Web Site: < a href = w3wiki </ a > < br > visit us: < br > w3wiki < 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 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 “w3wiki”.
- 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: w3wiki < br > Web Site: < a href = w3wiki </ a >< br > visit us:< br > w3wiki< 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 Tag
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>