structure

<header>

Represents introductory content or a group of navigational aids for its nearest sectioning ancestor. Use it at the top of the page, or inside an <article> or <section> for that block's heading area.

<header><h1>Site title</h1></header>

Common attributes

Attribute Purpose
class Styling hook
id Unique identifier
role ARIA override (rarely needed)

Examples

<header><h1>Utilko</h1><nav>...</nav></header>

Top-of-page banner with logo and nav

<article><header><h2>Post title</h2><p>By Ada</p></header>...</article>

Header scoped to an article

<header role="banner">...</header>

Explicit banner landmark (implicit when at document root)

Gotcha

A

is only the page-wide 'banner' landmark when it is a direct child of — nested headers are just section headings.
cannot contain another
or a
.

Related tags

← All HTML tags · CSS selectors · HTML entities