【发布时间】:2014-06-13 19:09:10
【问题描述】:
有人可以告诉我为什么 box-sizing 似乎不尊重 div 中的填充,因为下面的 fiddle example
// The code is too long for this but can be viewed using browser debugging tools
// and here is a picture that says it all.
左列固定宽度:190px;
右栏为 width:100% with margin-left: 190px
绿色的div是没有宽高的嵌套div:20px;
<style>
div {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
</style>
不应该填充将绿线推入左侧吗?
【问题讨论】: