<address> Tag in HTML
![JavaScript Course With Certification: Unlocking the Power of JavaScript](https://www.scaler.com/topics/images/mrinal_bhattacharya.webp)
Overview
The <address> tag in HTML is a block-level element and it is used to define an author's contact information on the webpage or an article. This contact information is relevant to the document or the information on the webpage or the article. You should not use the address tag to display other information.
Also, the address tag should not contain any other information like a paragraph, or some normal text, it should only contain the author's information. The address tag in HTML has different meanings when used at different places which you'll study later in this topic.
Generally, the address tag in HTML is displayed in italics. Some of the browsers add a line break before and after the address tag in HTML. Now, let's look at the syntax of the address tag in HTML.
Syntax
There are various tags available in HTML, to learn more about such tags, you can refer to Scaler Topics - HTML Tags.
Attributes
The address tag in HTML has no specific attributes and only supports global attributes. The address tag in HTML supports all the global attributes and some of them are mentioned below:
Attribute | Description |
---|---|
accesskey | The access key attribute specifies a shortcut to focus an element. |
autofocus | This specifies an element should automatically gets focus when the browser page loads. |
autocapitalize | This attribute is used to automatically capitalize the content of an HTML element. |
lang | This specifies the language of the HTML content. |
draggable | This attribute specifies whether an element is draggable or not. |
style | This is used to add the inline CSS style to the element. |
title | This specifies the extra information about an element, when a user hovers on the element, this title is displayed as a tooltip. |
How to Use <address> Tag in HTML?
As mentioned above in the syntax, the address tag requires both the opening tag and closing tag. The HTML address tag is used to display the contact information of the author of the article, web page, or the document. There are many ways in which you can use the address tag in HTML and they are mentioned below:
- If you use the address tag inside the body tag, then it specifies the contact information of the owner of the document. Hence, if you want to display the author of the whole document, then you can use the address tag inside the body tag in HTML.
- There is a tag in the HTML named article tag. If the address tag in HTML is used inside the article tag then it represents the contact information of the owner of the article.
- Generally, an address tag in HTML is used in the footer tag of the current section in the website.
Remember that the contact information inside the address tag in HTML should be context-specific. For example, physical address, phone number, e-mail, etc. which are relevant to the author's information. It must not be used as a styling element for any type of information.
Examples
Now, let's look at the examples and understand where you can use the address tag in HTML.
Example
In this example, the <address> tag in HTML is used inside the body tag and this denotes that the contact information is of the author of the document.
HTML
Output
Example
In the below example, the address tag in HTML is used to indicate the author of a specific section.
HTML
Output
As shown in the above example, the address tag in HTML is used to display the contact information of the author of the section.
Accessibility Concerns
- The address tag in HTML should not contain information other than the contact information of the author of the web page or the article.
- The address tag in HTML helps the search engine and the screen readers to locate the contact information of the docuemnt.
- Generally, an address tag in HTML can be placed inside the footer section of the current section.
Browser support
The below given list of browsers supports the address tag in HTML.
Browser | Yes / No |
---|---|
Chrome | Yes |
Edge | Yes |
Firefox | Yes |
Opera | Yes |
Safari | Yes |
Internet Explorer | Yes |
Conclusion
- The <address>tag in HTML is used to define the contact information of the author of the webpage.
- By default, the content present inside the address tag is displayed in the italics.
- Some of the browsers add a line break before and after the address tag in HTML.
- If the address tag is used inside the body tag then it represents the contact information of the author of the document.
- If the address tag is used inside the article tag then it specifies that the contact information is of the author of the article.