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 How to Make a Website Creating HTML Content Use the Navigation Element

prabhu lingam
prabhu lingam
6,955 Points

hi,if i want to create links at various places on the page instead of them being a list. Can i still put them in <nav>

can i put then in one place in nav.

Yes, You can place links anywhere on the page, Including multiply links to the same address, And yes you can put them in the nav tag.

P.S - Hope this helped :)

2 Answers

You do not want to put ordinary links in the nav tag. MDN states that the nav tag is for a section of links. You want to be careful of the purpose. I have seen several nav sections on a page, but usually in the header and footer.

If you want to create a link anywhere else in the document, use the a link because it defines a link within the document.

While the page may work if you do not follow these guidelines, your code will be sloppy and difficult to understand. It will also be more difficult to style well with CSS.

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

You can add links anywhere on your page. However, the nav tag is meant to denote the "navigation" section of the site. So, unless the links are part of your navigation, I'd recommend against putting them inside a nav tag. It won't break your code, but the code will look and be confusing to others and just is not semantically correct.