I'm making a navigation menu, should I be using the <nav>
element or <ul>
element for that?
If I use a nav
I'll prob need to use a shiv so that it works across browsers.
If that's so, what the advantage of using a nav
over a ul
?
EDIT:
I know you can put a ul
into a nav
my question is why use a nav
at all?
Depends on the case but most of the time you'll be using both.
Both are semantically correct.
The
nav
element is semantically more specific, so generally the better choice. A search engine, for example, will understand that the links within it represent navigation, rather than a simple list of links (which could be recommended posts, or related items etc).