The <header>
tag will create a container for the content within and render it like this:
Explanation
The <header>
tag is used to provide introductory content or a set of navigational links at the top of a web page. It is usually placed within the <body>
element.
In the example above, the <header>
tag contains a <h1>
tag that displays the website name, and a <nav>
tag that contains an unordered list of links to other pages on the website.
Use
The <header>
tag is used to create a container for introductory content or a set of navigational links on a web page.
Some possible use cases for the <header>
tag are:
- Displaying the name and logo of the website
- Providing navigation links to other pages on the website
- Displaying a search bar
- Displaying social media links
Important Points
- The
<header>
tag should be used only once per web page.
- The
<header>
tag is commonly used in conjunction with the <nav>
tag, which contains a list of links to other pages on the website.
- The
<header>
tag is usually placed at the top of the <body>
element.
Summary
The <header>
tag is used to create a container for introductory content or a set of navigational links on a web page. It should be used only once per web page and is commonly used with the <nav>
tag.