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

CSS

Images aren't aligned despite resizing.

Hi guys,

I used my own images for this and have resized them all to 1024x768 but the images won't align properly on the page. Any idea what I have done wrong? I've even tried using Nick's pictures and they do the same thing.

Here is my code. https://w.trhou.se/prd67gwdau

Thanks

2 Answers

Ok, fixed everything for you:

<ul id="gallery">
          <li>
            <a href="img/Squirrel.jpg">
              <img src="img/Squirrel.jpg" alt="">
              <p>A squirrel enjoying the sunshine</p>
            </a>

          <li>
            <a href="img/Flower.jpg">
              <img src="img/Flower.jpg" alt="">
              <p>Some early blooming flowers</p>
            </a>
          </li>

            <li>
              <a href="img/Bird.jpg">
                <img src="img/Bird.jpg" alt="">
                <p>Tweet tweet</p>
            </a>
          </li>

            <li>
              <a href="img/Deer.jpg">
              <img src="img/Deer.jpg" alt="">
              <p>A beautiful deer</p>
            </a>
          </li>

            <li>
              <a href="img/Squirrel 2.jpg">
              <img src="img/Squirrel 2.jpg" alt="">
              <p>A squirrel playing with twigs</p>
            </a>
          </li>
        </ul>

If you look at your code you can see you put many <ul> inside that one <ul>. Hope this helped.

Perfect, thank you very much!

That will teach me for using copy and paste!