CSS :nth-of-class selector
Publikováno: 23.3.2020
That's not a thing.
But it kinda is!
Bram covers how frustrating .bar:nth-child(2)
is. It's not "select the second element of class .bar
." It's "select the second element if it also has the class .bar
." The good news? There is a real selector that does the former:
:nth-child(2 of .bar) { }
Safari only. Here are the tickets for Chrome and Firefox.
Direct Link to Article — Permalink… Read article “CSS :nth-of-class selector”
The post CSS :nth-of-class selector appeared first on CSS-Tricks.
That's not a thing.
But it kinda is!
Bram covers how frustrating .bar:nth-child(2)
is. It's not "select the second element of class .bar
." It's "select the second element if it also has the class .bar
." The good news? There is a real selector that does the former:
:nth-child(2 of .bar) { }
Safari only. Here are the tickets for Chrome and Firefox.
Direct Link to Article — Permalink
The post CSS :nth-of-class selector appeared first on CSS-Tricks.