title: CSS inherit style
body: <p>I have a style set for many divs that looks similar. The only difference is that each div has different padding and margin setup. Something like this:</p>
  
  <pre><code>&lt;div class="mainStyle" id="cc"&gt;CC&lt;/div&gt;
  &lt;div class="mainStyle" id="bb"&gt;BB&lt;/div&gt;
  &lt;div class="mainStyle" id="aa"&gt;AA/div&gt;
  </code></pre>
  
  <p>And have:</p>
  
  <pre><code>.mainStyle {
      float: right;
      width: 60px;
      text-align : center;
      font: 95% Arial;
      -moz-border-radius: 5px;
      border-radius: 5px;
      background : #69abd0;
  }
  </code></pre>
  
  <p>And for each id have only:</p>
  
  <pre><code>#aa {
      margin: 0px 2px 0px 2px;
      padding: 2px 0 5px 0;
  }
  
  #bb {
      margin: 10px 2px 10px 2px;
      padding: 2px 0 5px 0;
  }
  
  #cc{
      margin: 10px 2px 10px 2px;
      padding: 20px 0 50px 0;
  }
  </code></pre>
  
  <p>I know this is the wrong syntax but I don't know how else to ask the question...
  I don't want to have a long style definition for each element id because they are %90 the same except the padding and margin. I want to somehow combine the style of the class and the element.</p>
  
  <p>How do I do this?</p>