Width of div with position:absolute content
<p>I have div without fixed width (this <code>div</code> should have width as it's content) in it there is div with <code>position:absolute</code> and fixed width, but relative div has <code>0px</code> width, how I can fix it?</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container" style="position:relative"&gt;
  &lt;div class="innerContainer" style="position: absolute; width: 30px; height: 10px"&gt;&lt;/div&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>