title: make two divs overlap each other
body: <p>I want to make two divs overlap each other using css. I used the following code but when some text or content is added to the blue box it overflows the gray box while I want to keep it inside the the gray box and stretch it as the inner content is stretched.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.gray {
    position: relative;
    background-color: #818181;  
  }
  
  .white {
    background-color: #fff;
  }  
  
  .blue {
    position: absolute;
    background-color: #0090ff;
    top: 0;
    right: 10px;
    left: 100px;
  }  </code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="gray"&gt;
    &lt;div class="white"&gt;
      left text
    &lt;/div&gt;  
    &lt;div class="blue"&gt;
      &lt;p&gt;some text goes here&lt;/p&gt;
      &lt;p&gt;some text goes here&lt;/p&gt;
      &lt;p&gt;some text goes here&lt;/p&gt;
    &lt;/div&gt;    
  &lt;/div&gt;
    </code></pre>
  </div>
  </div>
  </p>
  
  <p>here is my satisfactory result:</p>
  
  <p><img src="https://i.stack.imgur.com/y55Sp.jpg" alt="enter image description here"></p>
  
  <p>How can I correct the css to get the above result?</p>