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 How to Make a Website Creating HTML Content Organize with Unordered Lists

FAISAL MOUDUD
PLUS
FAISAL MOUDUD
Courses Plus Student 203 Points

where is the problem in this code?

can anyone tell me why this code is showing my isn't including?

index.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Nick Pettit</title>
  </head>
  <body>
    <header>
      <a href="index.html">
        <h1>Nick Pettit</h1>
        <h2>Designer</h2>
      </a>
      <nav>
        <ul>
          <li><a href="index.html">Portfolio</a></li>
          <li><a href="about.html">About</a></li>
          <li><a href="contact.html">Contact</a></li>
        </ul>
      </nav>
    </header>
   <section>
     <ul>
       <a herf="image/numbers-01.jpg">
       <li img src="numbers-01.jpg" alt=""></li>
       </a>
       <a href="image/numbers-02.jpg">
       <li img src="numbers-02.jpg" alt=""></li>
       </a>
        <a href="image/numbers-06.jpg">                                   
       <li img src="numbers-06.jpg" alt=""></li>
       </a>
     </ul>
    </section>
    <footer>
      <p>&copy; 2013 Nick Pettit.</p>
    </footer>
  </body>
</html>

2 Answers

iuliana sagaidak
iuliana sagaidak
4,797 Points
  1. In this line you have error<a herf="image/numbers-01.jpg"> Change herf to href:)
  2. You don't need to add links around images for this challenge, so you code for first image should look like this:
 <ul>
          <li><img src="numbers-01.jpg" alt=""></li>
  1. Then ad another two links for images

Hi,

I'll try to help.

In your code, you put the img tag as if it were an attribute of the li tag:

<li img src="numbers-01.jpg" alt=""></li>

but they are two different html tags, so if you want an img inside of a li:

<li>
  <img src="numbers-01.jpg" alt="">
</li>

I also see you have added a tags to link to the images files:

<a herf="image/numbers-01.jpg">
       <li img src="numbers-01.jpg" alt=""></li>
</a>

In the first one, there is a typo in the href attribute. You putted herf instead of href -this is not important, I make this mistake all the time-. However, I would like to point out that if in your a tag you type href="image/numbers-01.jpg" and in your img tag yout type src="numbers-01.jpg", you will be pointing to 2 different images that have the same name. One of them located in a directory called image and the other in your current directory.

But you do not need to include a tags. In fact, the challenge instructions tells you to do not add any link (a tags): "Leave the alt attributes blank, and don’t add any captions or links. Just the images!". The img tag does not require to use an a tag to include the image. Therefore, one of the possible code solutions would be:

<section>
     <ul>
       <li>
         <img src="numbers-01.jpg" alt="">
       </li>
       <li>
         <img src="numbers-02.jpg" alt="">
       </li>
       <li>
         <img src="numbers-06.jpg" alt="">
       </li>
     </ul>
</section>

I hope it helps.

Many thanks. Have a nice weekend,