CSS扩展div

时间:2013-04-07 21:28:43

标签: html css

我的CSS代码是这样的:

        #bottom {

             height: 100px;
             background-color: #afafaf;   
             width: auto;
             border-top: 4px solid green;
             margin-top: 90px;

        }

我的代码是:

<body>

    <div id="wrapper">      
        <div id="logo"></div>           
    </div>

        <a href=""><div class="box">Go to our forums &raquo; </div></a>

        <div id="bottom">TEST</div>

</body>

这就是它的样子:http://screencloud.net/v/cxEu

为什么它会显示div两端的差距?我希望它能在整个屏幕上显示。我尝试了不同的宽度,但没有任何效果。或者我做错了什么!

2 个答案:

答案 0 :(得分:1)

看起来身体的边缘,试试这个:

body {
    margin: 0;
}

答案 1 :(得分:0)

指定margin: 0padding: 0

#bottom {
  height: 100px;
  background-color: #afafaf;   
  width: auto;
  border-top: 4px solid green;
  margin: 0;
  padding: 0;
  margin-top: 90px;
}
相关问题