footer
The <footer>
tag is used in HTML to define the footer of a document or section.
It generally contains information such as author rights, navigation links, contact information, or other information related to the page or site.
Structure and syntax of the <footer>
tag
Basic structure and syntax
Here is the basic syntax of a <footer>
tag:
<footer>
Footer content here
</footer>
Usage example
Here is a typical example of a footer:
<footer>
<p>© 2025 MySite. All rights reserved.</p>
<a href="mailto:contact@mysite.com">Contact us</a>
</footer>
In this example, the <footer>
tag is used to include contact information and legal mentions.
Attributes
The <footer>
tag accepts classic HTML attributes such as:
class
: to apply CSS styles.id
: to identify a unique container.style
: to apply inline styles.
Best practices
Use the <footer>
tag to structure end-of-page information clearly. This improves accessibility and readability for users as well as for search engines.
Also, think about including relevant information such as your coordinates, links to legal pages (like the privacy policy or terms of use), and other details related to the entire site.
Difference with other similar tags
<header>
: The<header>
tag is used to define the header of a document or section, while<footer>
is specifically intended for the end of the content.<article>
: The<article>
tag defines standalone content that can be distributed, such as an article, whereas<footer>
is found at the end of this structure.
Browser compatibility
The <footer>
tag is supported by all modern browsers.
Browser | Compatibility |
---|---|
Chrome | Yes |
Firefox | Yes |
Safari | Yes |
Edge | Yes |
Internet Explorer | Yes |