2013-04-07 84 views
0

大家好,我的CSS代碼是這樣的:CSS擴大div的

 #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的兩端?我希望它能夠在整個屏幕上顯示。我嘗試了不同的寬度,但沒有任何作用。或者我做錯了什麼!

回答

1

看起來就像人體的利潤率,試試這個:

body { 
    margin: 0; 
} 
0

指定margin: 0padding: 0

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