Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Target with CSS all h2 EXCEPT first one on a page Re: Target with CSS all h2 EXCEPT first one on a page

#57741
noahgelman
Participant

@charlie, why would you need to designate range? :nth-of-type isn’t even built for ranges, you can only plug in basic equations. Also, your :nth-of-type(2-10) wouldn’t be “The second through tenth” it would be “Two minus ten”.

Just do this:

h2 { color: #fff; }

h2:nth-of-type(n+2) { color: #333; }

Or whatever those styles should be. The first style would target all H2’s and the second will target all H2’s other than the first.