Only let certain inner divs control outer div's width
I have the follow html structure:
Some TextSome Text
the container is
float:left. The container will stretch out to the widest div, but what if i only want it to follow block1, and have block2 and block3's text to wrap according to how big the image in block1 is. For my markup right now, if the text is long it will push out the container div as far as the text goes out, but I want the text to only be as wide as the image, almost like an image caption. Any ideas?
Make the container
overflow:auto; so that it automatically stretches to fit the content. Give Block #2 and Block #3
overflow:auto; too so that they stretch to fit their content.
This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here