HTML address
HTML Address <address>
tag is used to define contact information in an HTML document. The address can contain details like name, physical address, phone number, social medial handle, URL, email address, etc.
Example
A simple Address element is shown in the following example.
index.html
<!DOCTYPE html>
<html>
<body>
<p>Address Example</p>
<address>
Some One<br>
<a href="mailto:address@example.com">address@example.com</a><br>
India<br>
Ph. 0123456789<br>
<a href="https://www.tutorialkart.com/">TutorialKart</a>
</address>
</body>
</html>
Note: HTML Address element starts with the tag <address>
and ends with an end tag </address>
.
Default CSS for HTML <address>
By default, following CSS properties are set for an Address element.
font-weight: bold;
Inline Style for HTML Address Element
We can change the style of Address element through inline styling using style
attribute.
In the following example, we have set the color as green for the Address element.
index.html
<!DOCTYPE html>
<html>
<body>
<p>Address Example</p>
<address style="color:green;">
Some One<br>
<a href="mailto:address@example.com">address@example.com</a><br>
India<br>
Ph. 0123456789<br>
<a href="https://www.tutorialkart.com/">TutorialKart</a>
</address>
</body>
</html>
Apply CSS for HTML Address Element
We can apply CSS for all Address elements using the address
tag name.
index.html
<!DOCTYPE html>
<html>
<head>
<style>
address {
color:olivedrab;
}
</style>
</head>
<body>
<p>Address Example</p>
<address>
Some One<br>
<a href="mailto:address@example.com">address@example.com</a><br>
India<br>
Ph. 0123456789<br>
<a href="https://www.tutorialkart.com/">TutorialKart</a>
</address>
</body>
</html>
Conclusion
In this HTML Tutorial, we learned about HTML <address>
tag and went through different examples that cover defining an HTML Address element, and styling it.