Forum Moderators: not2easy
I don't want either of these things.
A third option would be to give the div a display: inline, the drawback being that it is then treated as an inline element in every way.
Are you sure you even needthe div 'collapsed' (I believe the usual term is 'shrinkwrapped') around the image? Is the div necessary? If it's right against the image, you may be able to apply your styles directly to the image itself.
This (the shrinkwrapping) should exist now or eventually, as I see no reason why it shouldn't.
If you're not willing to go the float route, you may have to use some form of scripting to detect the image width and apply this dynamically to the wrapper div.
If floating the div itself is unacceptable, you can add an extra <span> around the image/content and apply the float to that...
<div><span class="float_me"><img src="image.gif /></span></div>
[note]My suggestion above of using display:inline will work, but it only gives the "illusion" of shrinkwrapping; background colors will bleed right out of it.[/note]