is it possible in CSS or Stylus to apply style to an element if it has certain child class?
doing this for example:
.par > .chld
background-color:red
Will color the child, but I need to color the parent
How can I do that?
is it possible in CSS or Stylus to apply style to an element if it has certain child class?
doing this for example:
.par > .chld
background-color:red
Will color the child, but I need to color the parent
How can I do that?
You can't do that because CSS can't do that, unfortunately.
CSS has no ascending selectors (yet).
If you look at the CSS4 working draft, you can see a :has()
selector has been proposed.