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 trialWill Wacaser
2,354 PointsError message telling me to set the href to "pies.html" which I already did
Someone tell me I am tripping.
<!DOCTYPE html>
<html>
<head>
<title>Lists and Links</title>
</head>
<body>
<ul>
<a href="cakes.html"><li>Cakes</li></a>
<a href="pies.html"><li>Pies</li></a>
<a href="candy.html"><li>Candy</li></a>
</ul>
</body>
</html>
3 Answers
Matthew Long
28,407 PointsThe keyword for this challenge is "inside". It is expecting the anchor tags to be inside the list item tags:
<!DOCTYPE html>
<html>
<head>
<title>Lists and Links</title>
</head>
<body>
<ul>
<li><a href="cakes.html">Cakes</a></li>
<li><a href="pies.html">Pies</a></li>
<li><a href="candy.html">Candy</a></li>
</ul>
</body>
</html>
Will Wacaser
2,354 PointsThanks man! Will that always be the case?
Matthew Long
28,407 PointsFor this case you should have the list item be the direct child of the unordered list tag (same with ordered lists). Which means the anchor tag should be nested inside the list item tag.
There are other cases where it's much more acceptable to wrap the anchor tag on the outside. Such as when you want multiple elements to be the link.
Jason Anders
Treehouse Moderator 145,860 PointsHi Will,
Yes, when it comes to links inside of lists, this will always be the case, as the <li> tag is the only tag that can be a child of a list element.
:)
James Ackerman
14,099 PointsTo the best of my knowledge, yes.
James Ackerman
14,099 PointsJames Ackerman
14,099 PointsYou need to put the <a> tags inside the <li> tags.
For example...
<li><a href="cakes.html">Cakes</a></li>
Let me know if that helps.