The <header> element represents introductory content for a page or a section — typically a heading, logo, navigation, search, slogan, or byline.
A top-level page <header> (not inside <article>, <section>, <nav>, <aside>, or <main>) acts as the site banner landmark. Nested in those sections, it introduces that section only. Do not confuse it with <head> (document metadata).
Baseline · Widely available.
Not deprecated. Stable across browsers since about July 2015 (and earlier as HTML5).
Nesting rule.
Do not put <header> or <footer> inside a <header>, and do not nest <header> inside <footer> or <address>.
Syntax
HTML Syntax
syntax.html
<header>introductory content</header>
Both start and end tags are required. Content is flow content, but not another <header> or <footer>.
Reference
Attributes
The <header> element has no element-specific attributes — only global attributes.
Open <header> near the top of the body (outside main/article if it is the site banner).
Add a site title with a heading (often <h1> for the home page brand).
Include <nav> for primary links when needed.
Close the tag. Assistive tech can treat this as the banner landmark.
Example 2 — Article Header
Nest <header> inside <article> for the title and byline.
HTML
<article>
<header>
<h2>The Planet Earth</h2>
<p>
Posted on
<time datetime="2017-10-04">4 October 2017</time>
by Jane Smith
</p>
</header>
<p>We live on a planet that is blue and green.</p>
</article>
Put intro metadata (title, date, author) in <header>.
Keep the body after the header as normal paragraphs.
This header is not a banner — it only introduces the article.
Example 3 — Section Header
Introduce a <section> with a heading and short summary.
HTML
<section>
<header>
<h2>Getting started</h2>
<p>Install the tools, then write your first page.</p>
</header>
<p>Create an index.html file in your project folder.</p>
</section>
Page content goes here. (The document <head> is not visible.)
How It Works
<head> holds title, charset, stylesheets — not shown as page chrome.
<header> lives in <body> and is visible to users.
Put the brand / nav in <header>, not in <head>.
Main content usually follows in <main>.
Edge Cases & Pitfalls
Most header mistakes confuse head, nest landmarks badly, or put footers inside headers.
names
header ≠ head ≠ headings
head is metadata. h1–h6 are headings. header is an intro container that often includes a heading.
nesting
No header/footer inside header
Also avoid nesting header in footer or address. Keep the intro block simple.
a11y
Banner only at the top level
Inside article/section/nav/aside/main, header is not a banner landmark and should not be labeled as one.
count
Multiple headers are fine
One site banner plus article headers is normal. Do not force everything into a single header.
Compatibility
Browser Support
The <header> element is core HTML sectioning/flow content in every modern browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<header>
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera all support the element. Landmark behavior follows the nesting rules in the accessibility section above.
98%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet Explorer9+
Supported
<header>Widely supported
Bottom line: Safe to use for page and section intros. Keep head for metadata, and respect nesting rules so landmarks stay clear.
Remember
Key Takeaways
Role:<header> groups introductory content for a page or section.
Banner: top-level headers map to the site banner landmark.
Not head: document metadata stays in <head>.
Nesting: no header/footer inside header; pair with footer for page chrome.
One line: use <header> for intros — site banner at the top, or a local intro inside an article/section.
UA style
Default CSS Settings
Typical user-agent styling for header:
default.css
header {
display: block;
}
Layout (flex, sticky bars, backgrounds) comes from your CSS — the element itself is only semantic structure by default.
Frequently Asked Questions
The header element holds introductory content for a page or a section — often a heading, logo, navigation, search, or byline. It is not the same as the document <head>.
No. <head> is metadata for the document (title, links, scripts). <header> is visible introductory content in the page body.
No. You can have a site-wide header and also headers inside articles or sections. Nested headers introduce that section, not another page banner.
When it is not nested in article, aside, main, nav, or section (or matching ARIA roles), it maps to the banner landmark — typically the site header.
No. A header must not contain header or footer descendants, and must not be nested inside address, footer, or another header.
No, but a heading is common and helpful. Logo, nav, or search alone can also make a valid header.