<header>: The HEADER Element

Last updated: 2026-10-13

<header>The HEADER Element

Represents introductory content or a navigation area, commonly used at the top of a page or section (site title, logo, main nav).

CategorySemantic
Content ModelFlow content
Allowed ParentsAny element that accepts flow content
Content TagYes — requires closing </header> tag
StatusStandard

📝 Syntax

<header>header content</header>

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
<header> ✓ v1 ✓ v12 ✓ v1 ✓ v1 ✓ v1
Supported in all major browsers
Tip: header describes role/position, not to be confused with head; a page may have multiple headers (e.g. one per article).

❓ FAQ

QCan a page have only one header?
ANo. The page-level header usually appears once at the top of body, but every <article> or <section> can have its own <header> with that section's title and metadata. Note a header cannot be nested inside another header or a footer.
QWhat is the difference between header and h1?
A<h1> is the heading itself; <header> is an introductory container that may hold a logo, search box, navigation, and heading groups. Putting an h1 inside a header is a common combination, but a header with only a logo and nav is also perfectly valid.
QWhat is the difference between header and head?
ATwo entirely different elements: <head> is the document metadata container (invisible, holds title/meta/link); <header> is the visible page banner. Beginners often confuse them — head is written inside head, header inside body.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏