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 trialBrandon Winebrenner
5,938 Pointsimg'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
Courses Plus Student 15,815 PointsAre these class selectors (.gallery
) or ID selectors (#gallery
). Without a .
or #
it will look for an html element called gallery
, which doesn't exist.
James Andrews
7,245 Pointsignore me
Abdulla Alshubbar
31,298 Pointstry adding "#" before the word "gallery".
Example: #gallery
Jason Anello
Courses Plus Student 94,610 PointsHi 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.
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsThey'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.Shawn Flanigan
Courses Plus Student 15,815 PointsShawn Flanigan
Courses Plus Student 15,815 PointsAhh...nice catch. Hadn't seen that before. Now I know!