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

Code about CSS(basic)

I don't know how to write the corect code for this requirement:"Inside the media query, clear the left side of every 4th list item in the gallery." Thank you, if you can explain me.

3 Answers

Hello there,

This refers to the nth-child pseudo-selector which is pretty handy!

Here is an example of using it:


my_id ul li:nth-child(3n) {

color: #ccc; } '''

What the above CSS does, is select every third list item inside unordered lists inside an id called my_id. That is, the 3rd, 6th, 9th, 12th, etc.

Thank you so much! Was very userfull what you explain me!

My pleasure. :)