Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

<nav> or <ul> for website navigation.

Hello,

I would like to which is a better option to use nav or ul element for website navigation. what are the pro & cons of using both the elements, which one would you recommend and what is considered a best practice.

Thanks

2 Answers

Use both…

<nav>
  <ul>
    <li><a href="#">foo</a></li>
    <li><a href="#">foo</a></li>
    <li><a href="#">foo</a></li>
    <li><a href="#">foo</a></li>
    <li><a href="#">foo</a></li>
  </ul>
</nav>

Thankyou Wayne

Don't forget to use the html5shiv polyfill so you can style the nav in older versions of IE.

Al Lu
seal-mask
.a{fill-rule:evenodd;}techdegree
Al Lu
UX Design Techdegree Student 15,892 Points

Good to know. Any other general guidelines like this one for html 5 pages? Maybe some essential meta tags? Maybe a course on the topic can be useful.

Alon Lubin - That's what the HTML5 and you blog series over at Tuts Plus is for.

I would be careful on this one. IE 8 and below does not support the <nav> tag and there are still a lot of internet users on IE8 and earlier (unfortunately). Just a heads up.

Gracias... :)