伙计们,我正在使用这个 hack 来获得跨浏览器 100% 高度的 DIV
/* commented backslash hack \*/
html, body{height:100%;}
/* end hack */
html,body {margin:0;padding:0}
#outer{min-height:100%;height:auto;background:#ffffcc}
* html #outer{height:100%;}/* ie6 and under*/
编辑:但是在我的 div 上我有一个 1px 的上边框和一个 10px 的上边距。此添加总计 16px。
知道如何编辑此 css 以说明 16px 吗?
最佳答案
将其嵌套在一个新的 div 中,该 div 将自动接管其父级的宽度。
关于css - 100% div(DIV 顶部有 10px 边距),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1770065/