🚀 Levoric Learn v2.1.1: Improved tutorials, faster navigation, and more. Learn more

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>&copy; 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

AttributesDescription
accesskeySpecifies a shortcut key to activate or focus an element.
autocapitalizeControls whether and how text input is automatically capitalized.
classSpecifies one or more class names for the element, allowing CSS styling and JavaScript manipulation.
contenteditableSpecifies whether the content of an element is editable or not.
contextmenuSpecifies a context menu for the element.
dirDefines the text direction. Possible values are "ltr" (left-to-right), "rtl" (right-to-left), and "auto".
draggableSpecifies whether an element is draggable. Possible values are "true" or "false".
enterkeyhintSpecifies the action label or icon to be shown for the enter key on virtual keyboards.
hiddenIndicates that the element is not yet, or is no longer, relevant. The browser does not display elements that have the `hidden` attribute set.
idSpecifies a unique identifier for the element.
inputmodeProvides a hint to browsers for which virtual keyboard configuration to use when editing this element or its descendants.
isAllows you to specify the type of custom element.
langSpecifies the language of the element's content.
nonceA 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.
partSpecifies the element’s part in the shadow DOM.
slotAssigns a slot in a shadow DOM shadow tree.
spellcheckIndicates whether the element is subject to spell checking.
styleProvides inline CSS styling for the element.
tabindexSpecifies the tab order of the element.
titleAdds extra information about the element, displayed as a tooltip when hovering over the element.
translateSpecifies whether the content of the element should be translated. Possible values are "yes" or "no".
HTML AttributesGlobal AttributesEvent Attributes
To view the full list
To view the full list
To view the full list
elementsChrome BrowsersMicrosoft Edge BrowserFirefox BrowsersSafari BrowserOpera Browser
<footer>5.09.04.05.011.1