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

Mike Stewart
Mike Stewart
4,984 Points

Im having trouble entering in my image tags. I am putting it in like this "<li> img/numbers-01.jpg" and so on. Whats up?

need help with the proper way of entering in the image tag.

2 Answers

Stone Preston
Stone Preston
42,016 Points

if you want an image thats nested inside of a list item you need to use

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

the img tag is self closing, so you dont need to add a </img> on the end. the src attribute specifies the file path to the image, and the alt text is a description of the image for screen readers etc

Danielle Hill
Danielle Hill
26,062 Points

Hi Mike. Your image will need to go in an <img> tag with a "src" attribute. The "src" attribute is where you list the source, or path, to the image. Try this code below.

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

Happy coding!