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 Refactor the Layout

Karlis Kleinhofs
Karlis Kleinhofs
688 Points

Problem with media query

In challenge one of the tasks is to clear the left side of every 4th list item in the gallery, inside the media query. My code works in my workspace but when I write the same code in challenge it says that code is wrong.

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

/************************************************ TWO COLON LAYOUT ************************************************/

primary {

width: 50%; float:left; }

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

/************************************************ PAGE:Portfolio ************************************************/

gallery li {

width:28.3333%; }

gallery li:nth-cild(4n) {

clear: left; } }

2 Answers

Kyle Sullivan
Kyle Sullivan
15,150 Points

In your "li:nth-child(4n)", you misspelled child and put cild. That may fix your problem.

Hector Castillo
Hector Castillo
2,620 Points

Hi Karlis,

Your primary and gallery are ids just like your secondary . You are just missing the # at the beginning. Like so..

 /**********************************
  TWO COLUMN LAYOUT
  ***********************************/

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

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



  /**********************************
  PAGE: PORTFOLIO
  ***********************************/

  #gallery li {
    width: 28.3333%;
  }

  #gallery li:nth-child(4n) {
    clear: left;
  } 

Also Kyle is right about the misspell and needs to be fixed as well.