HTML <footer> Tag

Beginner
5 min read
Updated: Oct 2026
4 examples
Live preview

Definition and Usage

The <footer> element represents a footer for its nearest sectioning ancestor (or for the whole page when that ancestor is <body>). It commonly holds copyright, author credits, or related links.

Put author contact details in <address> inside the footer when needed. <footer> is not sectioning content — it does not start a new outline section.

Baseline · Widely available.

Not deprecated and not experimental. Stable across modern browsers since about July 2015.

Landmark tip.

A page-level footer maps to the contentinfo landmark. Nested in article, aside, main, nav, or section, it is not contentinfo.

HTML Syntax

syntax.html
<footer> flow content</footer>

Both start and end tags are required. Content is flow content, but not <header> or another <footer>.

Attributes

<footer> has no element-specific attributes. Use globals when needed:

AttributeDescriptionTry it
classStyle hook for page or section footer layoutTry it
idUnique target for skip links or in-page anchorsTry it
langLanguage of the footer when it differs from surrounding textTry it

Global Attributes

The <footer> tag also supports the Global Attributes in HTML.

Live Preview

Switch between a page-level footer and an article footer.

Footer

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Page Footer

When the nearest sectioning ancestor is <body>, the footer applies to the whole page.

HTML
<main>
  <h1>Welcome</h1>
  <p>Main content goes here.</p>
</main>

<footer>
  <p><small>Copyright &copy; 2026 CodeToFun</small></p>
</footer>
Try It Yourself

How It Works

  1. Place main content in <main> (or other body content).
  2. Add <footer> after the main content for site-wide info.
  3. Put copyright or site links inside the footer.
  4. Know the landmark: this page-level footer is contentinfo.

Example 2 — Article Footer

A footer inside an article belongs to that article, not the whole site.

HTML
<article>
  <h2>How to learn HTML</h2>
  <p>Start with headings, paragraphs, and links.</p>
  <footer>
    <p>Posted by Mari · Oct 2026</p>
  </footer>
</article>
Try It Yourself

How It Works

  1. Wrap the post in <article>.
  2. Add content (heading, paragraphs, and so on).
  3. Close with <footer> for author, date, or tags.
  4. Remember scope: nested footers are not the page contentinfo landmark.

Example 3 — Footer with Related Links

Site footers often include a small nav of related or legal links.

HTML
<footer>
  <nav aria-label="Footer">
    <a href="/about">About</a>
    ·
    <a href="/privacy">Privacy</a>
    ·
    <a href="/contact">Contact</a>
  </nav>
  <p><small>Copyright &copy; 2026 CodeToFun</small></p>
</footer>
Try It Yourself

How It Works

  1. Open <footer> for the site-wide block.
  2. Add a <nav> with an accessible name (for example aria-label).
  3. List related links such as About, Privacy, Contact.
  4. Keep copyright nearby in the same footer unit.

Example 4 — Author Address in Footer

Contact or author details belong in <address> inside the footer.

HTML
<article>
  <h2>Release notes</h2>
  <p>Version 2.0 is available.</p>
  <footer>
    <address>
      Written by <a href="mailto:[email protected]">Mari Selvan</a>
    </address>
  </footer>
</article>
Try It Yourself

How It Works

  1. Keep the article body above the footer.
  2. Open the article footer for author metadata.
  3. Wrap contact info in <address> (not street addresses alone — contact for the author/owner).
  4. Link email or profile when useful.

Edge Cases & Pitfalls

Most footer mistakes are about scope, nesting, or treating it like a styled box.

semantics

Not a layout div

Use <footer> for footer meaning. Use a plain <div> only when there is no footer semantics.

nesting

No nested footer / header

A footer must not contain <header> or <footer>, and must not sit inside <address> or another footer.

landmark

One contentinfo

Only the page-level footer is the contentinfo landmark. Article footers are fine, but they do not replace the site footer landmark.

outline

Does not create a section

<footer> is not sectioning content. It does not introduce a new entry in the document outline.

legacy

Old Safari VoiceOver

Before Safari 13, VoiceOver sometimes missed contentinfo. Only if you must support that era, add role="contentinfo" on the page footer.

Browser Support

The <footer> element is core HTML in every browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<footer>

Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera all support page and section footers.

98% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer 9+
Supported
<footer> Widely supported

Bottom line: Safe to use everywhere for page and section footers. Prefer semantic footer over a generic div.

Key Takeaways

  • Role: footer for the nearest sectioning ancestor (or the page).
  • Typical content: copyright, author, related or legal links.
  • Landmark: page footer → contentinfo; nested → generic.
  • Nesting: no header/footer inside; not inside address.

One line: use <footer> for the footer of a page or a section — not as a generic box.

Default CSS Settings

Typical user-agent styling (exact values can vary by browser):

default.css
footer {
  display: block;
}

Layout, padding, and borders come from your stylesheet — the element itself is a block box with no special default chrome.

Frequently Asked Questions

The footer element represents a footer for its nearest sectioning ancestor (or the whole page when that ancestor is body). It usually holds copyright, author info, or related links.
No. It only supports global attributes such as class, id, and lang.
Yes. You can have a page-level footer and also footers inside article, section, or similar sectioning elements.
div is a generic box with no meaning. footer tells browsers and assistive tech that the block is a footer for its section or the page.
A footer whose nearest sectioning ancestor is body maps to the contentinfo landmark. Nested inside article, aside, main, nav, or section, it is generic (not contentinfo).
No. A footer must not contain header or footer descendants, and it must not be nested inside address or another footer.

Next: form

Learn how to collect user input with the form element.

form tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful