Skip to content Skip to sidebar Skip to footer

Only Let Certain Inner Divs Control Outer Div's Width

I have the follow html structure:

Solution 1:

Make the container display:inline-block; with 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.

Unfortunately, you need to use JavaScript to get the width to be the width of the image. See my example below, where I fix it with jQuery.

See: http://jsfiddle.net/TFLMX/2


Post a Comment for "Only Let Certain Inner Divs Control Outer Div's Width"