CSS inheritance: applying selector for itself and every descendant

Posted by Cawas on Stack Overflow See other posts from Stack Overflow or by Cawas
Published on 2010-03-17T21:51:06Z Indexed on 2010/03/17 22:01 UTC
Read the original article Hit count: 497

Filed under:
|
|

Get a custom user CSS and type this

.answered-accepted {
  color: white !important;
  background: #090 !important;
}

Now go to answers.unity3d and look for an accepted answer. The design looks bad, because the <strong> in there overrides the customization. The fix I've found is this:

.answered-accepted, .answered-accepted * {
  color: white !important;
  background: #090 !important;
}

Now it looks fine on the website, but the code looks ugly!! How can I do this without repeating the class name?

© Stack Overflow or respective owner

Related posts about css

Related posts about css-selectors