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

Brandon Winebrenner
Brandon Winebrenner
5,938 Points

img's won't float

...css

gallery {

margin: 0; padding: 0; list-style: none; }

gallery li {

float: right; width: 45%; margin: 2.5%; background-color: #f5f5f5; color: #bdc3c7; }

...css

is there something i'm doing wrong? for some reason the images all stay in the same list.

4 Answers

Shawn Flanigan
PLUS
Shawn Flanigan
Courses Plus Student 15,815 Points

Are these class selectors (.gallery) or ID selectors (#gallery). Without a . or # it will look for an html element called gallery, which doesn't exist.

They're ID selectors.

When the css isn't posted correctly the # is interpreted as an h1 using markdown syntax. So we see them in bold and larger font size.

ignore me

Abdulla Alshubbar
Abdulla Alshubbar
31,298 Points

try adding "#" before the word "gallery".

Example: #gallery

Hi Brandon,

I don't know what you mean by "the images all stay in the same list."

The only thing I see wrong with the css you posted is that you have floated them right instead of left. This would cause them to appear in reverse order on each row.

Please clarify what you meant. The problem could be elsewhere in the css.