Is it possible to write a CSS rule to select the first child of an element without a specific class?
example:
In this case I would like to select the first span
without class ignore
.
I tried this, but didn't seem to work:
.common-class:first-child:not(.ignore) {
...some rules...
}
UPDATE:
If I add a class to the parent div named parent-class
, a modified version of the selector suggested by Jukka works except when the first span
with class ignore
comes after the first one without. The above-mentioned selector is the following:
.parent-class > .common-class.ignore + .common-class:not(.ignore) {
...some rules...
}
No comments:
Post a Comment