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

Colin Stell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Colin Stell
Front End Web Development Techdegree Graduate 25,702 Points

Can't Move Past This Question Even Though it's right

I have the right code but I keep getting the Bummer message.

<!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>

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>

2 Answers

Billy Bellchambers
Billy Bellchambers
21,689 Points

Hi Colin,

Your are really close here just play close attention to the nesting of your elements, these were intended to be list items with anchors inside.

You have created the reverse anchors with list items nested, the different results in something quite different.

Actual solution below for your reference.

Happy coding!

<!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>
Billy Bellchambers
Billy Bellchambers
21,689 Points

Great stuff, easy error to make I often find writing the nesting full helpful with issues like this. As you know the list items are the children of the list it makes it easier to identify the issues in your code.

Whilst both effectively resolve to the same thing its just a matter of preference when formatting your work to improve readability.

Glad you figured it out yourself though, solving your own issues tends to be where the real learning happens.

Eg.

<!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>