Stretching Background divs
- Started
- Last post
- 8 Responses
- scrap_paper
If I have two divs, a parent (with repeating vertical background) and a child (with copy) and I want the parent div to stretch to the height of the child how do I have to set up the css?
- lukus_W0
How far have you got?
Post a link ...
- acescence0
it should wrap to fit the child div as long as the child div isn't floated and you haven't given the parent div an explicit height
- scrap_paper0
http://www.kausticdesign.com/cil…
This is the page I'm working on.
- scrap_paper0
There are two child divs (one left and one right) with floats.
- lukus_W0
As acescence says above .. clearing (or lack of) is your problem.
Adding:
#middle-wrapper { overflow: hidden }
... should help.
- scrap_paper0
The #middle-wrapper { overflow: hidden } worked! Unreal.
I had a clear in there just above the footer. Do I need to clear the floats elsewhere?
- Clear floats by applying a clearfix class or overflow:hidden / auto to the direct parent container.lukus_W
- +1 clearfix is your friendacrossthesea