Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Creating HTML Content Create Navigation with Lists

Bimarsh Sapkota
Bimarsh Sapkota
164 Points

<nav> element

I am really not sure about this element and where to insert it. I am stuck in this...

2 Answers

Pedro GCA
Pedro GCA
20,683 Points

Hello Bimarsh, usually the nav element is used to identify the menu of your website. It also usually goes inside the tag header. It is just a kind of identifier and helps you to keep your code organized. Despite the name being different, it works in a very similar way of div id="nav".

The nav element stands for navigation. The navigation of a website is mostly used to travel between sections/pages of the website. It's a html element, just like a <div> is one, and it can contain any other elements. In most sites the <nav> element contains a set of links. Notice that <nav> is part of HTML5, and you need to use a shim if you want to get it working in old browsers.