CSS Questine

Out of context: Reply #16

  • Started
  • Last post
  • 19 Responses
  • monNom0

    what if you used a utility class that just obliterates all styling?

    ie

    <div class="parent">
    <div id="child" class="reset simpleChildClass">...

    .parent {
    background: blue;
    }

    /* #child is transparent */

    .parent div{
    background: green;
    }

    /* #child is green */

    .reset {
    background:transparent; ...
    }

    /* #child is transparent */

    .simpleChildClass{
    background: red;
    }

    /* #child is red */

    .reset would need to be a verbose list of all styles and defaults for them, but you could reuse anywhere/everywhere.

View thread