Image in absolute DIV is not positioning from containing DIV

妖精的绣舞 提交于 2020-01-15 12:09:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!