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 Responsive Web Design and Testing Build a Three Column Layout

Nathaniel Nasarow
Nathaniel Nasarow
10,291 Points

Images won't smoothly flow into colunms. Suspected word wrap problem.

Hey everyone,

So following Nick's coding, I still run into that problem where, at a certain size, the second column switches to one image, possibly due to word wrapping, for a small area before becoming a full, second column.

I've tried a few different ideas but have not come upon a solution to make it a smooth transition from mobile to desktop.

here is my code for this css.

@media screen and (min-width: 520px) { /************* Two column layout **************/

#primary { width: 50%; float:left; }

#secondary { width: 40%; float:right; }

/************* 3 * 5 = 15% for margins 100% - 15% = 85% for margins 85% / 3 = 28.3333333 **************/

/************* Page: Portfolio **************/

#gallery li { width: 28.3333%; }

#gallery li:nth-child(3n+1) ,{ clear: left; }

}

Please note: on the #gallery li:nth-child(3n+1) ~~ I've tried, so far, 2n+1, 3n, 4n, and 4n+1, but have not come upon a solution yet. I'm not quite sure where else to go to at this point.

1 Answer

Nathaniel Nasarow
Nathaniel Nasarow
10,291 Points

OMG it was that damn COMMA!

lol.

OK. Removed comma. Everything works. Please ignore xD