title: Dynamically calculate a div width
body: <p>Here are sample divisions:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#grandparent {
    width: 100px;
  }
  #parent {
    overflow: auto;
    height: 100px;
  }
  .child {
    overflow: hidden;
    margin-left: 10px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="grandparent"&gt;
  
    &lt;div id="parent"&gt;
  
      &lt;div class="child"&gt;1000000000000000000000000&lt;/div&gt;
      &lt;div class="child"&gt;1000000000000000000000000&lt;/div&gt;
      &lt;div class="child"&gt;1000000000000000000000000&lt;/div&gt;
      &lt;div class="child"&gt;1000000000000000000000000&lt;/div&gt;
      &lt;div class="child"&gt;1000000000000000000000000&lt;/div&gt;
      &lt;div class="child"&gt;1000000000000000000000000&lt;/div&gt;
      &lt;div class="child"&gt;1000000000000000000000000&lt;/div&gt;
  
    &lt;/div&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The <code>&lt;div class="child"&gt;</code> width value is always 10 pixels less than <code>&lt;div id="parent"&gt;</code> width value. How can it be calculated so any width value is given to <code>&lt;div id="parent"&gt;</code>, its child gets 10 pixels less than that?</p>
  
  <p>Any help is very much appreciated!</p>
  
  <p>Mike</p>