2014-11-04 25 views
0

我的問題是,當我在瀏覽器中查看它時,紅色不會填滿整個窗口。我希望它能使用100%的可用空間。我認爲bodyhtmlwidth不起作用,我還在我的頁面上添加了CSS重置。當我最小化頁面,身體顏色未填滿整個窗口

<!doctype html> 
 
<html> 
 
    <head> 
 
    <meta charset="utf-8"> 
 
    <title>Untitled Document</title> 
 
    </head> 
 
    <style> 
 
    body { 
 
     padding:0px; 
 
     margin:0px; 
 
    } 
 
    .container { 
 
     width:100%; 
 
     background-color:#F00; 
 
     float:left; 
 
    } 
 
    .inner-div { 
 
     width:980px; 
 
     background-color:#00F; 
 
     margin:0px auto; 
 
     height:200px; 
 
     color: #FFF; 
 
     font-family: arial; 
 
     padding: 19px; 
 
     margin-bottom: 22px; 
 
    } 
 
    </style> 
 
    <body> 
 
    <div class="main"> 
 
     <div class="container"> 
 
     <div class="inner-div"></div> 
 
     </div> 
 
     <div class="container"> 
 
     <div class="inner-div"></div> 
 
     </div> 
 
    </div> 
 
    </body> 
 
</html>

+0

使用html,body {height:100%} – 2014-11-04 05:44:20

+0

'