Forum Moderators: not2easy

Message Too Old, No Replies

Containing absolute positioned divs

         

KingOfSwing

11:16 am on Jan 18, 2008 (gmt 0)

10+ Year Member



Hi,

I have four liquid width columns which are absolutely positioned, that make up the footer for a layout.
The columns themselves work perfectly as far as I can tell, and display and resize exactly as expected.
However, I want to enclose them inside a containing div, to allow the entire footer area to be styled by users and the CMS.
Since absolute positioning removes elements from the flow, the containing div doesn't expand in height with the columns.
I'm hoping someone can point me in the direction of a solution or work around to allow a div that contains absolutely positioned elements to expand to fit the positioned elements.

Cheers for your time.

Xapti

6:49 pm on Jan 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can't really be done. Your options consist of fixing a height for the columns, and therefore fixing height of the container, using javascript to find the automatic height of the columns, and setting the container to that, or lastly, not using absolute positioning to do that... which seems to make the most sense to me. Why did you decide to use absolute positioning over a flow-based method.

KingOfSwing

7:31 am on Jan 19, 2008 (gmt 0)

10+ Year Member



Hi Xapti, thanks for the reply.
Absolute positioning worked the best out of everything I tried, since every other method I tried left me with uneven margins between the columns and the last column would jump to a new line on smaller screens.
I figured it probably wasn't really possible...Fixing the height or using javascript isn't really practical for this situation...
Don't suppose anyone has any advice on making reliable fluid width column layouts without absolute positioning?