Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

  1. Home
  2. HTML Tag Dictionary
  3. <header> / <footer>

<header> / <footer>

<header> is a semantic element that represents the introductory content or navigation for a page or section. <footer> represents the closing information for a page or section (such as copyright notices and links).

Syntax

<!-- Page-level header -->
<header>
  <h1>Site Title</h1>
  <nav>Navigation</nav>
</header>

<!-- Page-level footer -->
<footer>
  <p>© 2024 Site Name. All rights reserved.</p>
</footer>

Tag List

TagDescription
<header>Represents the introductory content of a page or section (such as headings, logos, and navigation).
<footer>Represents the footer information of a page or section (such as copyright notices, contact links, and related links).

Sample Code

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Header & Footer Example</title>
</head>
<body>

  <!-- Page-level header -->
  <header>
    <h1>Programming Learning Site</h1>
    <nav>
      <a href="/?lang=en">Home</a>
      <a href="/html/?lang=en">HTML</a>
      <a href="/css/?lang=en">CSS</a>
    </nav>
  </header>

  <!-- Main content -->
  <main>
    <article>
      <!-- Article header (header elements can be nested) -->
      <header>
        <h2>HTML Basics</h2>
        <p>Published: January 1, 2024</p>
      </header>
      <p>HTML is the language used to define the structure of web pages.</p>
      <!-- Article footer -->
      <footer>
        <p>Category: HTML Introduction</p>
      </footer>
    </article>
  </main>

  <!-- Page-level footer -->
  <footer>
    <p>© 2024 Programming Learning Site</p>
    <nav>
      <a href="/privacy/?lang=en">Privacy Policy</a>
      <a href="/contact/?lang=en">Contact Us</a>
    </nav>
  </footer>

</body>
</html>

Result

The site title and navigation appear at the top of the page, and copyright information with links appears at the bottom. The <header> and <footer> inside <article> represent the article's heading information and category information, respectively.

Overview

<header> and <footer> are semantic elements introduced in HTML5. Using them instead of the older <div id="header"> and <div id="footer"> patterns allows browsers and search engines to better understand the structure of your document.

These tags can be used not only as page-level header and footer, but also nested inside <article> or <section> elements. However, you cannot nest a <header> inside another <header>, or a <footer> inside another <footer>.

For related semantic elements, also see "main / article" for main content, and "section / aside" for sections and supplementary content.

Browser Compatibility

Chrome Chrome
49+
4 or earlier ×
Firefox Firefox
57+
3.5 or earlier ×
Safari Safari
18+
4 or earlier ×
Edge Edge
80+
11 or earlier ×
IE IE
11+
8 or earlier ×
Opera Opera
48+
11 or earlier ×
iOS Safari iOS Safari
18+
4 or earlier ×
Android Browser Android Browser
37+
4 or earlier ×
Chrome Android Chrome Android
36+
17 or earlier ×
Firefox Android Firefox Android
79+
3 or earlier ×

If you find any errors or copyright issues, please .