nav
In this module we will discuss the <nav>
tag.
File Location
For this module, you should be working in the following location:
Description:
The <nav>
tag is typically used to collect a set of navigation links. This is not intended to suggest that every link in your application should be encapsulated inside of a <nav>
. The links collected in a <nav>
are usually used to traverse through different pages in your application, usually in a navbar at the top of your application.
Sample Code
Add the following sample code to your file:
Discussion
We've provided two examples above, but there are innumerable ways to accomplish this task, and the needs of the application may demand a specific solution. The first example is typical and produces a horizontally-aligned navbar. In the second example, we've specified that the browser should render the navbar vertically as an unordered list by using <ul>
and <li>
tags.
Challenge
Extra Reading:
Last updated