【发布时间】:2014-06-30 14:18:39
【问题描述】:
Firefox 忽略带有 box-sizing:border 框的 padding-bottom。 我正在尝试将两个子 div 放入 300px 的容器 div 中。 child1 - 身高 100%; child2 - 从底部高度 100px;
child1 有边框和 padding-bottom:100px,这应该将 child1 的高度降低到 (100% - 100px),让位于 child2。 此实现在 webkit 中运行良好,但 firefox 失败。 有没有办法解决这个问题?我不想使用 css calc()。
这里是示例 - http://jsfiddle.net/827D6/1/
使用的css:
.container{
height:300px;
width:300px;
background-color:black;
}
.child1{
height:100%;
background-color:red;
position:relative;
padding: 20px 20px 100px;
box-sizing: border-box;
overflow-y:auto;
word-wrap:break-word;
}
.child2{
height:100px;
position:relative;
background-color:green;
bottom:100px;
}
【问题讨论】:
标签: javascript jquery html css