What CSS selector can be used to select all odd elements inside a parent, but which are not necessarily siblings?
-
2021-01-16 05:56
I couldn't get it down to single selector, but with two...
.parent > .element:nth-of-type(2n){
background:#afa !important;
}
.parent > div:nth-of-type(2n) > .element {
background:#afa !important;
}
View it on JSFiddle