Forums

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

Home Forums CSS Styling li except when a parent div has specific class Reply To: Styling li except when a parent div has specific class

#234720
Senff
Participant

I want everything with class=”b” green, except when found in any parent with class=”a”.

Based on that, you can just target the parent class, no?

.a .b {
   background-color: transparent;
}

http://codepen.io/senff/pen/pjxByw