HTML and CSS Reference
In-Depth Information
Using the <nav> element
Using the <nav> element in an HTML5 document provides users with navigation through the
main elements of the web document or web application as a whole. These main navigation
elements could be represented as a list of links across the top of the page to navigate the
current website. It could also list your favorite websites along the side of the page, such as in a
blog where you list other favorite blogs that you follow.
Typically, the list of links across the top, commonly known as the main menu of the web
application, is contained in the header (but doesn't have to be). A list of favorite URLs would
most likely be placed into an <aside> so that the list could be placed off to the side, away
from the main content but readily accessible. For the current example, you create a main
menu across the top of the page. This HTML code produces the output in Figure 1-3:
<body>
<header>
<h1>Some fictional company Website</h1>
<nav>
<a href="Home.html">Document Structure</a>
<a href="Blog.html">Writing Code</a>
<a href="About.html">Styles</a>
</nav>
</header>
</body>
FIGURE 1-3 A navigation menu created using the <nav> element
The other main element commonly used under the <header> element is the rightfully
named <hgroup> .
 
Search WWH ::




Custom Search