Skip to content Skip to sidebar Skip to footer

How Can I Contain An Absolute Positioned Div In A Relative Positioned Div?

How can I contain an absolute positioned div inside a relative positioned div? For example, a structure like this: Will result as the height of the contentWrapper to be 0 (when el

Solution 1:

No, this is not possible, you can only use a clearfix to clear floated elements.


Solution 2:

If the only element inside your relatively positioned container is positioned absolute, you will have to specify a height on the container. The problem is that position:absolue removes the element from the content flow, so the container doesn't recognize the absolutely positioned element's height.


Post a Comment for "How Can I Contain An Absolute Positioned Div In A Relative Positioned Div?"