I have some HTML that looks something like this:

```
<div id="outerdiv">
    <img id="imageDiv" src="file here" />
    <div id="innertext">Some text here</div>
</div>

```

I want the `#outerdiv` width to be defined by the image width. The image is of variable width.
The problem is that the text in `#innertext` expands `#outerdiv` to the full width of the page.

UPDATE:
Being a noob here I'm not allowed to answer my own question yet, but...

I got it working by adding a single line of jQuery.

```
$('#outerDiv').width($('#imageDiv').width());

```