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 trialElissa Bowling
7,370 PointsI'm putting in exactly what the prompt is telling me and it's coming in incorrect. Bug?
I'm putting in exactly what the instructions say (namely <a href="pies.html"> on the second line item, but it's telling me I still need to do that. Looks like a bug?
<!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
Steven Parker
231,248 PointsYour links are "inside out". The link (a) should be inside the list item (li).
A good rule of thumb to remember: all direct children of a list (either "ul" or "ol") must be list items ("li").
Jason Anders
Treehouse Moderator 145,860 PointsHi Elissa,
Unfortunately, it's not a bug, but you are are on the right track.
A key thing to remember here is that a list element (either an ordered list
<ol> or unordered list
<ul>) can only have list items as their direct children. In your code, the direct child is an anchor
element <a>.
So, everything is there, it's just a bit mixed up.
The proper syntax for links in lists would, therefore, be:
<ol>
<li><a></a></li>
</ol>
With these hints, I'm sure you'll get it now
Nice work! :)
Elissa Bowling
7,370 PointsAwesome, thank you!
Adam Beer
11,314 PointsAdam Beer
11,314 PointsHello Elissa. Change the line for example: <li><a href="cakes.html">Cakes</a></li>. And it does work. Cheers!