Skip to content Skip to sidebar Skip to footer

Css Relative Div's Width Auto Extend By Absolute Div

Is it possible to get parent (position: relative) auto extend its width by its absolute child? Here is my jsfiddle link: http://jsfiddle.net/YD2Xu/ The ideal is #container and #f

Solution 1:

You can't expand parent's div according to the child's size if child's position is absolute, because elements with absolute position are removed from the flow, so their size and even being are ignored by other elements including the parent. You can set fixed size with CSS or use javascript.

Solution 2:

Try

overflow:auto;

for parent;

Post a Comment for "Css Relative Div's Width Auto Extend By Absolute Div"