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 trialDomnick Knowlton
1,904 PointsCan you help me with the code challenge?
Here is the link to the challenge
5 Answers
Carl Vereen
10,992 PointsNot 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
15,083 PointsIn 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;
}
Domnick Knowlton
1,904 PointsNo, first one is not working.
Jon Peterson
12,661 PointsFirst, 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
1,904 PointsNot working for the first one.
Sreng Hong
15,083 PointsHi Domnick, you need a hash symbol before gallery!! It's an id. <br>
#gallery li {
width: 28.3333%;
}
Domnick Knowlton
1,904 PointsIt is still not working.
Domnick Knowlton
1,904 PointsI fixed number one by myself, thanks for the help anyways guys.