Closed oldoc63 closed 2 years ago
This can be compared to the code below which uses a <div>
tag instead of a <header>
tag:
<div id="header">
<h1>
Everything you need to know about pizza!
</h1>
</div>
By using a <header>
tag, our code becomes easier to read. It is much easier to identify what is inside of the <h1>
‘s parent tags, as opposed to a <div>
tag which would provide no details as to what was inside of the tag.
A <nav>
is used to define a block of navigation links such as menus and tables of contents. It is important to note that <nav>
can be used inside of the <header>
element but can also be used on its own.
Change <div>
to <header>
and <nav>
respectively.
A
<header>
is a container usually for either navigational links or introductory content containing<h1> to <h6>
headings.