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

HTML How to Make a Website Responsive Web Design and Testing Build a Three Column Layout

Luke Plourde
Luke Plourde
8,793 Points

nth child has been applied but the 4th image still pushes the 5th image to the bottom left. What can be done?

@media screen and (min-width: 480px) {

    /********************************
    TWO COLUMN LAYOUT
    *********************************/
  #primary {

    width: 50%;
    float: left; 

  }
}

  #secondary {

    width: 40%;
    float: right;  
  }

      /********************************
    PAGE: PORFOLIO
    *********************************/


  #gallery li {


  width: 28.3333%;
   }

  #gallery li: nth-child(4n) {

  clear: left; 
   }



@media screen and (min-width:660px) {


}

3 Answers

Luke Towers
Luke Towers
18,572 Points

You appear to have a typo in your selector:

#gallery li: nth-child(4n) {

should be

#gallery li:nth-child(4n) {

(no space after the li and before the :pseudo-class)

Luke Plourde
Luke Plourde
8,793 Points

Thanks so much! That seems to have fixed it.

Luke Towers
Luke Towers
18,572 Points

No problem, happy to help!

Mobolaji Kamson
Mobolaji Kamson
1,421 Points

thats a very subtle difference between pseudo-class and the : for properties and values.