Skip to the page
html reference · layout

HTML <header> tag

closing tag
required
void element
no
lives inside
<body>
typically holds
a heading, logo, or intro content

Where it goes

At the start of <body>, before <main>. It sits next to <main>, <nav> and <footer>, not inside them.

Example

<header>
  <h1>Site Name</h1>
</header>

Open this example in the editor →

Common mistakes

  • Mixing it up with <head>. They are different tags. <head> is invisible information about the page. <header> is content people see.
  • Putting it inside <main>. It usually sits beside <main>, not inside it.

Related

Updated 24 October 2026. Practice it in the html route, or read more on MDN.