Loading tutorials
:nth-child() counts elements and how to write the An+B expressions it accepts. It assumes you can write CSS rules with type, class, and attribute selectors, and that you know the descendant and child combinators. It also assumes you have seen :first-child and `:last-child6 min read:nth-child() An+B syntax from the previous chapters and that you understand the difference between a child and a sibling. The new idea here is that a position can be counted among elements of one 4 min read>) combinators. It also assumes you know a selector's specificity decides which rule wins when several match. The chapter on specificity covers that in full. Here you on4 min read::before and ::after create content that has no HTML tag, and where that content can go wrong.5 min read::first-line and ::first-letter, two pseudo-elements that style part of a block's text without any extra HTML. It assumes you know CSS rule syntax, the type, class, ID and attribute selectors, the difference between a pseudo-class and a pseudo-element (double colon), and the 6 min read:is(), :where(), :not() and :has(), and how specificity is counted. Here you will use them in four reusable patterns, then go 5 min read