I just launched a new course on ES6! Use the code WESBOS for $10 off.

Strengthen your core JavaScript skills and master all that ES6 has to offer. Start Now →

How do :nth-child() and nth-of-type really work?

Apr 11 2016

I get this question a lot so I thought I’d make a quick video.

When you have a list of items, nth-child() and nth-of-type may not do exactly what you think they do.

Check this quick video for some clarity. Enjoy!

This entry was posted in CSS. Bookmark the permalink.

4 Responses to How do :nth-child() and nth-of-type really work?

  1. Quick and to the point …..why cant all vids be like this!

  2. Alex McCabe says:

    I can’t really watch videos at work, is there a text version?

  3. BS says:

    Good vid. Kind of missing a solution though. What if I want the second ‘special’ element to be highlighted?

Leave a Reply

Your email address will not be published. Required fields are marked *