The <header
>
element is used to organize all the content that goes at the top of a page. As you saw in the preceding screenshot, this includes a main heading, a subheading (where that is used), and the navigation structure.
So, the <na
v>
content—the links at the top of a page—are included in the <header>
element when they are placed at the top of a page. Navigation elements placed in sidebars are also enclosed within the <nav>
element, but as—in this case—they are not part of the header, they are not enclosed in the <header>
element.
Within a <header>
element, CSS styles associated with tags (such as <h1>
, <h2>
, and so on), or with class Div tags can be used to supply additional formatting rules for how content will be displayed.