3 回答

TA貢獻1852條經(jīng)驗 獲得超7個贊
我更改了 css 文件并使其成為這樣,現(xiàn)在可以使用了:
.header{
padding-bottom:5px;
width:100%;
position:fixed;
top:0;
z-index:100;
height:70px;
background-color:#006}
.footer{
text-align:center;
width:100%;
position:fixed;
bottom:0;
z-index:100;
height:70px;
background-color:#006}
.content{
min-height: 100%;
width:100%;
background-color:#FFFEA5;
margin-top:70px;
margin-bottom:60px }
.content2{
height: 100%;
margin:auto;
width:95%;
background-color:#FFFEA5;
padding-bottom: 80px;
}
.wrapperDiv{
background-color: #006;
padding:0;
margin:0;
height: 100%;
}

TA貢獻2036條經(jīng)驗 獲得超8個贊
也許你可以嘗試將所有這些 div 放入父 div 中,并將該 div 設(shè)置為 100% 寬度和高度(高度不是必需的,它也會設(shè)置 100%),然后你將擁有占據(jù)整個屏幕的 div 容器。

TA貢獻1829條經(jīng)驗 獲得超9個贊
我相信您丟失了并且需要身體標簽(除其他外),它將整個背景設(shè)置為藍色。
body{
background-color:#006
}
header{
padding-bottom:5px;
width:100%;
position:fixed;
top:0;
z-index:100;
height:70px;
background-color:#006}
.content{
min-height: 100%;
width:100%;
background-color:#006;
margin-top:70px;
margin-bottom:60px }
.content2{
margin:auto;
min-height: 100%;
width:95%;
background-color:#FFFEA5;
padding-bottom: 20px;
}
.footer{
text-align:center;
width:100%;
position:fixed;
bottom:0;
z-index:100;
height:70px;
background-color:#006}
<html>
<body>
<div class="container">
<div class="header"></div>
<div class="content">
<div class="content2">test</div>
</div>
<div class="footer"></div>
</div>
</body>
</html>
- 3 回答
- 0 關(guān)注
- 240 瀏覽
添加回答
舉報