0
我无法将保证金底部属性添加到已拉伸以匹配浏览器高度的元素。例如:保证金底部不与基于百分比的高度一起工作
HTML:
<body>
<section></section>
</body>
CSS
html, body {
height: 100%;
min-height: 100%;
background-color: #FFF;
}
section {
height: 100%;
min-height: 100%;
margin-bottom: 50%;
background-color: #000;
}
无论像素也不百分比值工作,以延长边距属性。
附上说明我的问题的jsfiddle:margin-bottom problem
谢谢!
它的工作原理,好像你要'padding'而不是'margin' –