Copied successfully!
Introduction to <footer>
tag
The <footer>tag in HTML is a semantic element used to define the footer section of a webpage or a section within the webpage. It typically contains information related to the section it is associated with, such as copyright notices, links to privacy policies, contact information, or author details.
Key Features of the <footer>
Tag
Semantic Structure: The <footer>tag helps in structuring content in a way that is meaningful both to web browsers and search engines. By using this tag, developers can clearly indicate that the content within it is intended to serve as the footer of a webpage or a section.
Placement: The <footer>tag is usually placed at the bottom of a webpage or at the end of a section. It can be used multiple times on a single page, meaning each section of a webpage can have its own footer.
Content: The content within a <footer>tag typically includes:
- Copyright Information: This is one of the most common uses, indicating ownership of the content on the page.
- Social Media Links: Many websites include links to social media profiles in the footer.
- Contact Details: Information such as an email address, phone number, or physical address is often placed in the footer for easy access.
- Site Map or Navigation Links: Footers often include links to important pages on the site, such as a site map, privacy policy, or terms of service.
- Author or Company Information: Some websites include information about the content creator or the organization responsible for the site.
Accessibility and Usability: The <footer>tag enhances the accessibility of a webpage by providing a consistent place for important links and information. Screen readers and other assistive technologies can easily identify the footer section, improving navigation for users with disabilities.
Styling: The <footer>tag can be styled using CSS like any other HTML element. Developers often use CSS to align text, change background colors, and adjust the spacing within the footer to match the overall design of the site.
SEO Benefits: While the <footer>tag itself does not directly impact SEO, the placement of important links and information within it can improve user experience and site structure, which indirectly benefits search engine optimization. A well-structured footer can help search engines understand the layout and hierarchy of a website.
Copy to clipboard
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>title of <footer> tag</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Footer Example -->
<footer class="custom-footer">
<div class="footer-content">
<p>© 2024 Your Company Name. All rights reserved.</p>
<nav class="footer-nav">
<a href="#">Privacy Policy</a> |
<a href="#">Terms of Service</a> |
<a href="#">Contact Us</a>
</nav>
</div>
</footer>
</body>
</html>
Copy to clipboard
/* CSS for Footer */
.custom-footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 20px;
position: fixed;
width: 100%;
bottom: 0;
}
.footer-content {
max-width: 1200px;
margin: auto;
}
.footer-nav a {
color: #aaa;
margin: 0 10px;
text-decoration: none;
}
.footer-nav a:hover {
color: #fff;
}
Global Attributes
Attributes | Description |
---|---|
accesskey | Specifies a shortcut key to activate or focus an element. |
autocapitalize | Controls whether and how text input is automatically capitalized. |
class | Specifies one or more class names for the element, allowing CSS styling and JavaScript manipulation. |
contenteditable | Specifies whether the content of an element is editable or not. |
contextmenu | Specifies a context menu for the element. |
dir | Defines the text direction. Possible values are "ltr" (left-to-right), "rtl" (right-to-left), and "auto". |
draggable | Specifies whether an element is draggable. Possible values are "true" or "false". |
enterkeyhint | Specifies the action label or icon to be shown for the enter key on virtual keyboards. |
hidden | Indicates that the element is not yet, or is no longer, relevant. The browser does not display elements that have the `hidden` attribute set. |
id | Specifies a unique identifier for the element. |
inputmode | Provides a hint to browsers for which virtual keyboard configuration to use when editing this element or its descendants. |
is | Allows you to specify the type of custom element. |
lang | Specifies the language of the element's content. |
nonce | A cryptographic nonce ("number used once") that can be used by Content Security Policy (CSP) to determine whether or not a given fetch will be allowed to proceed. |
part | Specifies the element’s part in the shadow DOM. |
slot | Assigns a slot in a shadow DOM shadow tree. |
spellcheck | Indicates whether the element is subject to spell checking. |
style | Provides inline CSS styling for the element. |
tabindex | Specifies the tab order of the element. |
title | Adds extra information about the element, displayed as a tooltip when hovering over the element. |
translate | Specifies whether the content of the element should be translated. Possible values are "yes" or "no". |
HTML Attributes | Global Attributes | Event Attributes |
---|---|---|
To view the full list | To view the full list | To view the full list |
elements | |||||
---|---|---|---|---|---|
<footer> | 5.0 | 9.0 | 4.0 | 5.0 | 11.1 |
Improve Our Platform
Did you find what you were looking for?
Learn how to contribute.Last updated on January 12, 2025by our contributors.
View this page on GitHub• Report an issue with this content