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 Make a CSS Image Gallery

omar othman
omar othman
7,441 Points

is there a bug?

I'm tasked to make the pictures float to the left and set the width to 45%, there's the code so far, is something wrong with it? otherwise I think there's a bug

gallery{

float: left; width: 45%; }

should it not be.gallery or #gallery? you are not selecting your tag.

omar othman
omar othman
7,441 Points

yeah, I wrote it already, I think where you type the question doesn't allow symbols like these, but I already wrote it

As a suggestion... Copy the code directly from your editor and paste it into the forum. The system does a really good job at formatting it as it appears in the editor. It also allows us to grab it and insert it into our own editor for testing purposes.

From your included code my guess would be that you haven't identified the name properly, as a class or id (.gallery #gallery). But as Kevin points out below, you also have to think about what specifically needs to be floated? Is it the gallery itself or the items IN the gallery?

Keep up the good work buddy!!

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

I think that particular question is asking for list items nested inside an element with an id of gallery. You're missing the list item part of your selector.

omar othman
omar othman
7,441 Points

so, what should I write?

Kevin Korte
Kevin Korte
28,149 Points
#gallery li {
  float: left;
  width: 45%;
}