问题
I have a DIV with position:absolute inside another with position:relative. But the inside DIV is flowing out of the other and positioning it self based on the browser not the containing DIV. Any ideas why this is happening?
You can see the problem here:
https://www.luxedesignerhandbags.com/Articles.asp?ID=239
Look at the botton right "Get Cash for your handbags"
The image is in div id="sell_bag" and that is contained in div id="wrapper"
The css is as follows:
#wrapper {
position:inherit;
font-family: Quicksand, Arial, Helvetica, sans-serif;
width: 980px;
left: 24px;
margin: auto;
}
#sell_bag {
position:absolute;
right: 190px;
width: 260px;
}
Any help would be greatly appreciated!
Thanks,
回答1:
I would probably try position:relative; if you have not already. position:absolute; will be positioned against the first absolutely positioned parent (in it's lineage), or the browser window. If that does not work, try adding !important to your width (width: 260px !important;). Just some ideas!
回答2:
position: relative
on the containing div
来源:https://stackoverflow.com/questions/4411362/image-in-absolute-div-is-not-positioning-from-containing-div