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 Styling Web Pages and Navigation Style the Portfolio

Mariano Giustozzi
Mariano Giustozzi
3,351 Points

Cant make #gallery works

this is the code that doesnt work :

<section >

    <ul id="img">
      <li>
        <a href="img/numbers-01.jpg" >

            <img src="img/numbers-01.jpg" alt="">
              <p>Experimentando con formas y colores</p>

        </a>
      </li>


    </ul>
     <li>
        <a href="img/numbers-02.jpg" >

            <img src="img/numbers-02.jpg" alt="">
              <p>Gran numero usando photoshop</p>

        </a>
      </li>
     <li>
        <a href="img/numbers-06.jpg" >

            <img src="img/numbers-06.jpg" alt="">
              <p>Numero espacial</p>

        </a>
      </li>
     <li>
        <a href="img/numbers-09.jpg" >

            <img src="img/numbers-09.jpg" alt="">
              <p>9 con jirones</p>

        </a>
      </li>
     <li>
        <a href="img/numbers-12.jpg" >

            <img src="img/numbers-12.jpg" alt="">
              <p>12 magico</p>

        </a>
      </li>

  </section>

I dont know where ID "Gallery" should be written in order to CSS works with the images .

Thanks!!

Rasbin Rijal
Rasbin Rijal
Courses Plus Student 10,864 Points

Hi Mariano, Can u provide the link to the challenge task?

3 Answers

Maximillian Fox
PLUS
Maximillian Fox
Courses Plus Student 9,236 Points

Hey there,

In your HTML, try changing this line:

 <ul id="img">

to this line

 <ul id="gallery">

Currently your CSS is not working because no element in your page has the id of gallery, so your CSS selector is not selecting anything at all to apply its styling. I hope this works :)

Mariano Giustozzi
Mariano Giustozzi
3,351 Points

Thanks a lot for the answers, the problem was that in CSS instead of writting " gallery {}... I used "#", when i remove that "#" the problem was solved

Joshua Paulson
Joshua Paulson
37,085 Points

Just like Max said, you need to classify the ID by changing it to the desired name "gallery". If you don't change it from "img" as the ID you won't be able to select it in your CSS

Hopefully this is a bit easier to understand