【发布时间】:2015-12-03 12:42:26
【问题描述】:
我正在尝试将一个框设置为页面的 100% 高度。但是在 Chrome 和 IE 中,以下内容从页面底部延伸了几个像素,所以我必须滚动。为什么?为什么这里有滚动条?
<!doctype html>
<html >
<head>
<style type="text/css">
html, body
{
margin: 0px;
padding: 0px;
height: 100%;
}
div {
border:5px solid black;
height: 100%;
}
</style>
</head>
<body >
<div >This flows a few pixels off the bottom of the page</div>
</body>
</html>
【问题讨论】: