[thelist] Shrink wrapping a div?

Sam-I-Am sam at sam-i-am.com
Fri May 14 09:38:41 CDT 2004


I didn't see a good answer to this.
div { float: left; } will have the shrink-wrap effect you're looking 
for. The downside - You'll need to clear the float in the next element

Sam

Maximillian Schwanekamp wrote:
> I'm drawing a blank here, though it must be a stupid question. Can someone
> smack me around and show me how to make a div "shrink wrap" around its
> content?  I.e. If I put Xpx-wide element inside the div, I want the div to
> be Xpx wide (plus padding and border), not 100% of the content width for its
> parent.
> 


More information about the thelist mailing list