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.

nvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsAnchor element inside inside element
In this exercise, I see Mr. Nick put anchor element inside list element. Is there any semantic meaning to it?
Here is the code
<nav>
<ul>
<!--anchor element is a child to list element here.-->
<li><a href="index.html">Projects</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li>
<ul>
</nav>
It seems wrapping list element with anchor element have the same result.
<nav>
<ul>
<!--list element is a child to anchor element here.-->
<a href="index.html"><li>Projects</li></a>
<a href="about.html"><li>About</li></a>
<a href="contact.html"><li>Contact</li></a>
<ul>
</nav>
1 Answer

Alex Age
Courses Plus Student 6,387 PointsYes, it is semantic becouse <li>
have to be a direct child of a <ul>
(unordered) or <ol>
(ordered list) and <a>
creates the navigation meaning you can click on a link and go to another page.
nvcxnvkldsjaklfds
Courses Plus Student 5,041 Pointsnvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsAlex Age Very sorry. I do not get it.
Alex Age
Courses Plus Student 6,387 PointsAlex Age
Courses Plus Student 6,387 PointsPost updated
nvcxnvkldsjaklfds
Courses Plus Student 5,041 Pointsnvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsYou mean
html <li>
should be direct child ofhtml <ul> or <ol>
?Alex Age
Courses Plus Student 6,387 PointsAlex Age
Courses Plus Student 6,387 PointsYes, I do.
nvcxnvkldsjaklfds
Courses Plus Student 5,041 Pointsnvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsAlex Age Thank you so much for detailed explanation.
Alex Age
Courses Plus Student 6,387 PointsAlex Age
Courses Plus Student 6,387 PointsYou're welcome!