What is the <header> element in HTML?
The <header> element in HTML is used to display the introductory content of the webpage. This includes the heading, any sub-headings, logo, author’s name, and navigational links for the website. For example, <header> can be used to wrap the title of an article, the author’s name, and the byline of the article.
Elements that can be used inside the <header> element include:
<h1>-<h6><hgroup><p>
However, <header> cannot be placed under:
- another
<header> <footer><address>
Example
Explanation
In lines 5-11, you can see the <header> element and the elements inside it that display the introductory content of the simple webpage.
<hgroup>groups the<h1>,<h2>, and<h3>headings.<h1>and<h2>display the main heading of the page.<h3>heading displays the author of the page.<header>acts as a container that wraps this introductory content.
Free Resources
Copyright ©2026 Educative, Inc. All rights reserved