更新到最新的 chrome 版本 (87.0.4280.66 (Official Build) (64-bit)) 后,带有边距底部的元素在高度为 100% 的父元素内时不再获得该边距。
你能告诉我这是否可以作为一个错误报告给谷歌,或者他们现在所做的是否应该是这样,所以其他所有浏览器基本上都有一个错误,而 Chrome 是唯一一个做对的?
HTML
<html>
<body>
<div>
test
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
CSS
body,
html {
height: 100%;
}
body {
background-color: red;
}
div {
background-color: white;
min-height: calc(100vh - 32px);
margin-bottom: 200px;
}
Run Code Online (Sandbox Code Playgroud)
JS Fiddle 在这里:https : //jsfiddle.net/nez3aLqx/1/(在最新的 chrome vs firefox 中尝试)
aho*_*jim -4
您可以在css中使用!important来获得比其他人更高的优先级,例如下面的代码,希望可以解决问题,
div {
background-color: white;
min-height: calc(100vh - 32px);
margin-bottom: 200px !important;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
904 次 |
| 最近记录: |