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

CSS CSS Layout Techniques Display Modes Inline-Block Formatting

Why add anchor elements inside the li element?

What is the purpose? <header class="main-header"> <h1 class="main-logo"><a href="#">Logo</a></h1> <ul class="main-nav"> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> <li><a href="#">Link 4</a></li> </ul> </header>

Thanks

1 Answer

Matt Biggers
Matt Biggers
6,694 Points

The anchor elements make the text inside of your list items hyper links. Using a "#" is something you can use to make a hyper link still act like one on your page, without having to have an actual link to a web page.