title: Nesting CSS Classes in Html
body: <p>I need something for a dynamic project, and what I want is to make a class that every header element takes some properties, <strong>the children can be or not be direct descendants</strong>, however, inside that class can be another class that must overwrite the first class properties... I want those classes to be nested like 3-4 times.... is there a way to do this, to not take too much css space?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.something1 h1{
    color: green;
  }
  
  .something2 h1{
    color: red;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class='something1'&gt;
    &lt;div&gt;
    &lt;h1&gt;Green&lt;/h1&gt;
    &lt;/div&gt;
    &lt;div class='something2'&gt;
      &lt;h1&gt;Red&lt;/h1&gt;
      &lt;div class='something1'&gt;
        &lt;div&gt;&lt;div&gt;
        &lt;h1&gt;Green&lt;/h1&gt;
        &lt;/div&gt;&lt;/div&gt;
        &lt;div class='something2'&gt;
          &lt;div&gt;
          &lt;h1&gt;Red&lt;/h1&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://jsfiddle.net/eauwr8zo/1/" rel="nofollow noreferrer">https://jsfiddle.net/eauwr8zo/1/</a></p>