HTML <footer> Element

Publish in HTML Tutorial el 24/05/2025 14:34

The <footer> element represents a footer for its nearest sectioning content or root element. Typically containing metadata, copyright information, author details, related documents, or navigation links. Unlike traditional footers in documents, HTML footers can appear multiple times on a page - at the bottom of the entire page or at the end of individual sections/articles.


Key Characteristics:

  • Semantic HTML5 element
  • Can be used multiple times per page
  • Typically contains authorship info, copyright data, contact info
  • Often includes navigation links or social media icons
  • Improves accessibility and SEO when used properly


Basic Syntax

Here's the basic structure of a footer element:


Usage Examples

Example 1: Basic Page Footer

A simple footer with copyright information and authorship:

Play Code


Example 2: Footer with Navigation Links

A footer containing navigation links and social media icons:

Play Code


Example 3: Article Footer

A footer used within an article element:

Play Code


Example 4: Footer with JavaScript (Current Year)

A footer that automatically updates the copyright year using JavaScript:

Play Code


Example 5: Footer with Back-to-Top Button

A footer with a functional back-to-top button using JavaScript:

Play Code


Best Practices and Tips

Semantic Structure

Always use the <footer> element semantically - for footer content, not just as a styling container.


Accessibility Considerations

  • Use proper heading structure within footers
  • Ensure sufficient color contrast for text
  • Provide text alternatives for icons
  • Use ARIA landmarks when appropriate


SEO Tips

  • Include relevant keywords in footer content naturally
  • Link to important pages (but avoid excessive links)
  • Use structured data for contact information
  • Keep footer content consistent across pages


Creative Ideas

  • Add a newsletter signup form
  • Include trust badges or certifications
  • Implement a dark/light mode toggle
  • Add a sitemap or quick links section
  • Include a "Thank you for visiting" message

También te puede interesar

HTML <style> Element
HTML <style> Element

The <style> HTML element contains style information for a document, or part of a document. ...

HTML <strong> Element
HTML <strong> Element

The <strong> element is used to indicate that its content has strong importance, seriousnes...

HTML <span> Element
HTML <span> Element

The <span> element is an inline container used to mark up a part of a text or document. Unl...

HTML <source> Element
HTML <source> Element

The <source> element is used to specify multiple media resources for media elements like &l...

HTML <small> Element
HTML <small> Element

The <small> element is used to represent side-comments and small print, typically for discl...

HTML <section> Element
HTML <section> Element

HTML <section> Element: The Complete Guide The <section> element is a semantic HTML ...