Set div to the width of content with max width
<p>I have a div that contains a float left image and then text. It does the following.</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>.outer-div {
  max-width: 95%;
  background-color: yellow;
  display: inline-block;
}
.image {
  float: left;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="outer-div"&gt;
  &lt;img class="image" src="http://www.w3schools.com/images/colorpicker.png"&gt;
  &lt;div class="test"&gt;Here is some text that I want the outer div to size to without line-breaking.&lt;/div&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>Note, how it creates the outer div size based on the text alone and then it inserts the floating image, causing the text to wrap. I want the outer div width to be the width of the floated image + the width of the text, and then only line-break when it reaches the max-width of 95%.</p>

<p>EDIT: I also don't want ALL of the text to go below the image once the first line reaches the edge of the page. However, when there is a lot of text, I do want it to wrap under the image. </p>