How can I create a popup that fits its content perfectly?
<p>I know this is very hard, and I also tried many "solutions" on the web, but none of those actually fit perfectly. I have a hard time calculating its outer frame's dimensions, but luckily I can sort of know what is the dimension of the content inside by making the <code>body</code> float left.</p>

<pre><code>body{       /*Or div*/
    float: left;
}

ctnWidth = document.body.offsetWidth;
ctnHeight = document.body.offsetHeight;
</code></pre>

<p>Is there a perfect way (or a better way) to achieve it and fits it perfectly? (not necessarily cross browser) Since I can't find any answers on Google.</p>

<p>Thanks.</p>
