请帮我解决 CSS 边距的一个小问题。
HTML:
<body>
<div id="wrapper">
<div id="content"></div>
</div>
</body>
CSS:
* { margin:0; padding:0; }
body {
background-image: url('/images/pat_1.gif');
background-repeat: repeat;
}
#wrapper {
background-color: #fff;
margin: 0 auto;
width: 960px;
}
#content {
background-color: #fff;
margin: 0 -50px;
}
里面#content有很多带有width: 960px;. 我在这里写的是负边距background-color: #fff;,因为我的#wrapper. 一切都很好,直到我将浏览器的窗口大小调整为 960px - 主要问题是窗口边框的右负边距不会消失,它不会像左边距一样隐藏。
我已经尝试过overflow: hidden,但它没有帮助。
谢谢你的建议