HTML Address Tag
The <address> tag is used to define contact information for the person or the organization that owns a webpage. This tag is meant to hold things like names, physical addresses, email IDs, phone numbers, or even links to social media profiles.
When a browser sees this tag, it usually displays the content inside it in italic style, to make it look slightly different from the rest of the text. But remember, the main purpose of the <address> tag is not just to style, but to semantically mark the content as contact details.
Syntax -
<address>
Your contact info goes here
</address>
The content inside this tag can include:
- Name of the author or company
- Physical address
- Email address
- Phone number
- Links to social media or contact pages
Example -
Scenario - A basic example so you can see it in action
<!DOCTYPE html>
<html>
<head>
<title> address example</title>
</head>
<body>
<address>
Contact us at:
TutorialsCampus
123 Main Street, Hyderabad, India
contact@tutorialscampus.com
Phone: +91-9876543210
</address>
</body>
</html>
Output -
Contact us at:
TutorialsCampus
123 Main Street, Hyderabad, India
contact@tutorialscampus.com
Phone: +91-9876543210
TutorialsCampus
123 Main Street, Hyderabad, India
contact@tutorialscampus.com
Phone: +91-9876543210
Explaining Example -
- The text appears in italic by default.
- Each part of the address appears on a new line (because of the <br> tags).
- The email address is clickable, so when users click it, their email client (like Gmail or Outlook) will open.
Where Should the <address> Tag Be Placed?
The <address> tag is usually placed:
- At the bottom of a webpage, like in the footer, to show who owns the site or how to contact them.
- Near the author section of an article or blog post, to give credit or provide author contact info.