margin-bottom is calculated differently in Opera

蹲街弑〆低调 提交于 2019-12-24 02:09:38

问题


I have a div with relative position and a children div with position absolute.

<div id="container" class="out">
    <div id="inside"></div>
</div>

CSS:

#container {
    width:100px;
    height:100px;
    position: relative;
}
#inside {
    position:absolute;
    top:25px;
    left:25px;
    right:25px;
    bottom:25px;
    margin-bottom:24px;
}

Chrome, Safari and Firefox seem to work correctly but Opera browser (in Mac) is calculating margin-bottom twice.

This a fiddle: http://jsfiddle.net/4fw9wc0o/1/

Is this a bug or am I missing some property?


回答1:


Seems like the Opera browser offered in the App Store is version 12, more than a year and a half outdated (actual is 25). Downloading it directly from their website and opening the jsfiddle doesnt show any conflict.




回答2:


Opera browser does not overrides the bottom property with margin-bottom... so it seems that margin bottom doubles by mistake in the browser.



来源:https://stackoverflow.com/questions/26660252/margin-bottom-is-calculated-differently-in-opera

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