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 Introduction to HTML and CSS (2016) Adding a New Web Page Test: Link It Up Challenge

Xavier Mcloud
Xavier Mcloud
1,664 Points

need help writing the code

I don't know how to write the code

index.html
<!doctype html> 
<html>
  <head>
    <title>Al's Restaurant</title>
  </head>
  <body>
    <li><a href="#">"menu.html"</a></li>

        <ul class="nav">
          <li><a href="#">Home</a></li>
          <li><a href="food-gallery.html">Food Gallery</a></li>
          <li><a>Menu</li></a>
        </ul>
  </body>
</html>

3 Answers

Damien Bactawar
Damien Bactawar
8,549 Points
<li><a>Menu</li></a>

This should be -

<li><a>Menu</a></li>

The anchor tag is "inside" the list tag.

Temitope Ogunleye
seal-mask
.a{fill-rule:evenodd;}techdegree
Temitope Ogunleye
Full Stack JavaScript Techdegree Student 2,186 Points
\\  The anchor tag should surround the <li> tag like this: <a><li>Menu <li><a>
\\ The <li> tag should should not surround the <a> tag.

<!doctype html> 
<html>
  <head>
    <title>Al's Restaurant</title>
  </head>
  <body>
        <ul class="nav">
          <li><a href="#">Home</a></li>
          <li><a href="food-gallery.html">Food Gallery</a></li>
          <a><li>Menu</li></a>
        </ul>
  </body>
</html>
``
Damien Bactawar
Damien Bactawar
8,549 Points

I tested your code and it works but why are "Home" and "Food Gallery", anchor tags inside list tags?

Temitope Ogunleye
seal-mask
.a{fill-rule:evenodd;}techdegree
Temitope Ogunleye
Full Stack JavaScript Techdegree Student 2,186 Points

Damien Bactawar , The Home and Food Gallery are the right ways to use the html <a> tags. We wouldn't use the html<a> tags without the href attribute in real life programming. The question tests to see if we know what an anchor tag is.

This href attribute is what is used to link an html page to another html page.