Introducing the nth-of-type pseudoclass

Part of the new CSS3 standard, the nth-of-type and nth-last-of-type pseudoclasses are a useful way to select elements on a website, such as odd or even elements, or every 3rd or 4th element. Learn how this simple selector can impact your next project.

By Jen Kramer
May 19, 2016
nth-of-type pseudoclass nth-of-type pseudoclass

Learn the ins and outs of CSS with CSS: The Definitive Collection, a series of short and practical ebooks taken from the upcoming book CSS: The Definitive Guide, 4th Edition.

Learn faster. Dig deeper. See farther.

Join the O'Reilly online learning platform. Get a free trial today and find answers on the fly, or master something new and useful.

Learn more
Post topics: Web Programming