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

5 Answers

Carl Vereen
Carl Vereen
10,992 Points

Not sure if you found both answers yet but they are here in the responses.

Here they are together:

1.

 @media screen and (min-width: 480px) {
  #gallery li {
    width: 28.3333%; 
  }

2.

 @media screen and (min-width: 480px) {
  #gallery li {
    width: 28.3333%; 
  }
 #gallery li:nth-child(4n+4) {
    clear: left;
  }
}

First you need to declare the selector and then within the selector declare the change needed. The second one requires a starting child (the 4th one) and then adding 4 allows us to select the 4th one of each list.

Hope that helps,

Sreng Hong
Sreng Hong
15,083 Points

In the 1 of 2 challenge, it's asked you the select the list item in id gallery and put the width = 28.3333% inside the media query on line 89. <br>

And the second challenge is asked you to clear the left side of the 4th list item in id gallery. It should use pseudo class nth-child() and it will be like this<br>

#gallery li:nth-child(4n) {
  clear: left;
}
Jon Peterson
Jon Peterson
12,661 Points

First, add on line 93:

gallery li {

width:28.3333% }

them for the next task on the line immediately after the last bit of code add

gallery li:nth-child(4n+0){

clear:left;

}

Domnick Knowlton
Domnick Knowlton
1,904 Points

Not working for the first one.

Sreng Hong
Sreng Hong
15,083 Points

Hi Domnick, you need a hash symbol before gallery!! It's an id. <br>

#gallery li {
  width: 28.3333%;
}
Domnick Knowlton
Domnick Knowlton
1,904 Points

I fixed number one by myself, thanks for the help anyways guys.