HTML <address> Tag

Hyper Text Markup Language, HTML is the best markup language for creating Web pages. HTML consists of a wide variety of elements. In all of these elements, one element is most important for providing websites Author Information, which is the address tag.

The contents of an <address> element can contain any type of contact information that is required, such as geographical coordinates, a physical address, a URL, an email address, a phone number, and so on the form that the contact information takes depends on the context. The name of the individual(s) or group(s) to whom the contact information pertains should be included in the <address> element.

The term "address" has many applications, including displaying a company's contact information in the page header and identifying the right author of an article by including an "address" element in the "article" tag.

The contact information written between <address> tags mostly render in the italic form on the browser.

Syntax of <Address> tag in HTML

<address><h3For More Details<h3>
<a href = "https://www.tutorialandexample.com">Know More About Html </a>
</address>

Example of <Address> tag in HTML

<!DOCTYPE html>
<html>
<body>
<h1>The address element</h1>


<address>
Written by <a href="mailto:[email protected]">John Doe</a>.<br> 
Visit us at:<br>
Example.com<br>
Box 564, Los Angeles<br>
USA
</address>


</body>  

Output

Html <address> Tag

The <address> tag must be contained inside the <article> element if you want to specify an article's author's information.

The majority of browsers add a line break before and after the element, and the data in the tag is displayed in italics.

Styling Of Address Tag

  • You can use some of this attribute to style the address tag.
  • CSS Font Style: The CSS font-style attribute controls the font style. initial; standard; italic; oblique; inherit
  • CSS Font Family: For the selected element, it specifies a prioritized list of one or more general family names and/or font family names.
  • Font size is controlled via the CSS attribute.
  • The CSS Typeface Weight property of a font controls whether it should be thick or bold.
  • Text decoration is described by the CSS property text-decoration, which is short for text-decoration-line, text-decoration-color, and text-decoration-style.

Important Points in Address Tag

  • If there is a footer for the current section, it is formalized to place an <address> element there.
  • Previously, an <address> element could only be used to indicate the author of the document's contact information. However, in the latest versions definition has been improved because it can now also be used to markup arbitrary addresses.
  • Publication date or other information instead of contact information should not be included in an address element (instead, use the <time> tag).
  • The only type of content that may be used in an address tag is flow content, which implies that an address tag cannot be used as a parent of another address element or as a child of another address element
  • Most browsers will change in italic the text inside the <address> tag, but CSS styling allows you to change this behavior.
  • Except when those addresses contain the section's contact details, the address tag may not be used to indicate arbitrary addresses (such as postal addresses). You only need to use the <p> tag to display postal addresses.
  • <article>, <aside>, <nav>, <section>, <header>, <footer>, <hgroup, h1-h6 and other address> components are not permitted in the <address> tag.
  • Use HTML5, a JavaScript workaround, to enable the new HTML5 elements like <main>, <header>, <article>, <section>, <nav>, <aside>, and <footer> in Internet Explorer browsers older than IE 9.

Attributes

The <address> tag does not currently have a specific attribute that should be used with it.

1. Global Attribute

The HTML5 <address> tag supports all the attributes similarly to all other existing HTML tags.

2. Event Attribute

The address tag in HTML 5 supports all the event attributes.

Browser Compatibility

  • Chrome
  • Safari
  • Opera
  • Firefox

Conclusion

Address tag helps to provide authors information on who designs any website or blog. In the form of Link URL, email information, address, etc. It is very useful in emergencies and helps from the website author. It shows in italic form and you can give your styling by CSS. This tag is embedded in the article tag.



ADVERTISEMENT
ADVERTISEMENT