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

abhishek rajan
abhishek rajan
8,668 Points

about navigation element

is it necessary to put the navigation element .I mean, can we write code only using anchor element.

Ernests Millers
Ernests Millers
7,184 Points

Well, nav element works as grouping tool and it is also useful for a semantic code. You can apply CSS styles to the anchor element by selecting the nav otherwise, you would need to write class attribute to each of anchor element. The reason of the nav is that it also helps you read your code as you immediately see that it is used for navigation and it is important for Search Engine Optimisation and screen readers. The nav tag is NOT needed when there is single anchor tag, it is about your main site navigation.

1 Answer