The <header>
tag is use to defined the title, headings, search form, author information, logo elements of the website or the article.
The <header>
tag usually contained <h1> - <h6>
elements or <hgroup>
element, but it’s not required.
<header>
<h1>Page Title</h1>
<h2>Categories</h2>
<p>Paragraph</p>
</header>
We usually place them inside the <article>
<article>
<header>
<h1>Page Title</h1>
<h2>Categories</h2>
<p>Paragraph</p>
</header>
</article>
An HTML document are allow to have more than one <header>
element. The <header>
should be related of the element. But, the <header>
tag cannot be placed within a <footer>
, <address>
or another <header>
element.
Browser Compatibility
Browsers | Chrome | Edge | FireFox | Safari | Opera |
---|---|---|---|---|---|
<header> | 5.0 | 12.0 | 4.0 | 5.0 | 11.1 |