My question is, can I get the actual size of a div's content when div's width is 'auto' and the content is small enough to fit without resizing.


I know there is a way to find the div's actual size after it's loaded - divObj.offsetWidth/Height.

The problem is that this only works for content which is bigger than the div.

For example,
Code:
<div style="width:30px;">A text that will exceed 30px in width</div>
In this case, when the content is loaded the div will be resized and get a new offsetWidth/Height.
There will be lots of new lines after the resizement which posses another problem. After loading, the above example will look like this:
Code:
A
text
that
will
exceed
30px
in
width
Now the example has offsetWidth little more than 30px (~50) and MUCH greater height.

This is not the desired effect. I want the width/height of the content when the div is not resized by the content.


Thanks in advance