title: Align two divs on same line without setting width
body: <p>I can't find an example with two divs one aligned to the left and the other to the right which are on the same line without setting the <code>width</code> to them. I also need a responsive solution. Any ideas?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.left {
    float: left;
  }
  .right {
    float: right;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;div class="right"&gt;
      &lt;img src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcT8JRcAEUeQSC6Do6htEEyzIIqgmlRJrTOdthM9EcU2ynvx6fSN" width="120" /&gt;
    &lt;/div&gt;
    &lt;div class="left"&gt;
      The solution comes from the display property. Basically you need to make the two divs act like table cells. So instead of usign float:left, you'll have to use display:table-cell on both divs, and for the dynamic width div...
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>