我已经为我的网站实现了流体布局。我已将body标签的宽度设为100%。
<html>
<head>
</head>
<body>
<div id="container">
some content
</div>
</body>
body
{
margin: 0;
padding: 0;
width: 100%;
}
一些页面会出现垂直滚动条,导致 body 标签的宽度减少了 16 像素。我需要设置 body 标签的宽度,使得滚动条的显示不会影响它。我已经尝试了下面的方法,但在 Firefox 9 上无效:
请问有没有什么方法可以实现这个目标?body{ width: -moz-calc(100% - 16px); }
min-height
比强制使用给定百分比的height
更好。 - danijar