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 HTML Basics Getting Started with HTML Lists and Links Challenge

I've entered the following: <a href="cakes.html"><li>Cakes</li></a> <a href="pies.html"><li>Pies</li></a>

THe challenge won't let me proceed to the next session as it says I have a problem with the code. What do I do next?

index.html
<!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>

Thanx, I"m very new to HTML. I do other programming where I can code Alltrim(upper(var)) or Upper(alltrim(Var)). Didn't realize my mistake in the challenge. I'd like to be able to see the solution when I give up and entering the correct code.

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're doing great, but your tags are a bit backward. The only allowed direct descendant of an unordered list is a list item. Because of this, you need to have your links inside of your list items. Right now, your list items are inside of your links. Try reversing the positioning and giving it another go!

Hope this helps! :sparkles:

Dan Weru
Dan Weru
47,649 Points

hey, you were doing great. You just need to ensure that the a tags are wrapped between li tags and not the other way round. The other thing to consider is that the immediate children of unordered lists (ul tag) should always be list items (li 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>

Happy coding