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 How to Make a Website Styling Web Pages and Navigation Style the Portfolio

Cory Bates
Cory Bates
2,502 Points

Images not floating left, need help!

I've been reviewing all the questions here and it looks like i have one that is very similar. I feel like i've done everything exactly like Nick has here, but i must have missed something. Could someone please take a look and let me know? The images are displaying all in one column, and the light grey color (#f5f5f5) isn't showing up behind the text under the images.

Here is my GENERAL section:

/*******************************************
GENERAL
*******************************************/

body {
  font-family: 'Alegreya', serif;
}

#wrapper {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 5%;
}

a, a:visited {
  text-decoration: none;
  color: #6ab47b;
}

img {
  max-width: 100%;
}

And here is the PAGE PORTFOLIO section:

/*******************************************
PAGE: PORTFOLIO
*******************************************/

#gallery {
  margin: 0;
  padding: 0;
  list-style: none;
}

#gallery li {
  float: left;
  width: 45%;
  margin: 2.5%;
  background-color: #f5f5f5;
  color: #bdc3c7;
}

Here is my HTML.

        <ul id="gallery">
          <l1>
            <a href="img/numbers-01.jpg">
              <img src="img/numbers-01.jpg" alt="">
              <p>This is text that goes below the image</p>
            </a>
          </l1>
          <l1>
            <a href="img/numbers-02.jpg">
              <img src="img/numbers-02.jpg" alt="">
              <p>This is text that goes below the image</p>
            </a>
          </l1>
          <l1>
            <a href="img/numbers-06.jpg">
              <img src="img/numbers-06.jpg" alt="">
              <p>This is text that goes below the image</p>
            </a>
          </l1>
          <l1>
            <a href="img/numbers-09.jpg">
              <img src="img/numbers-09.jpg" alt="">
              <p>This is text that goes below the image</p>
            </a>
          </l1>
          <l1>
            <a href="img/numbers-12.jpg">
              <img src="img/numbers-12.jpg" alt="">
              <p>This is text that goes below the image</p>
            </a>
          </l1>
        </ul>

3 Answers

Cesar Vanbuskirk
Cesar Vanbuskirk
6,672 Points

I think your using l1 instead of li.

Cory Bates
Cory Bates
2,502 Points

Yes, it appears i am! Zero idea how that happened, but i appreciate your answer Cesar!