我在這一塊上撞牆。我正在設計一個登錄頁面,其中有一個全屏幕圖片背景,停在頁腳處。所以基本上我相信我的麻煩在於創建一個粘腳。全屏幕圖片背景 - 頁腳室
我一直在關注教程this website。
這裏是我的HTML:
<!DOCTYPE html>
<html>
<head>
<code omitted>
</head>
<body>
<div id="wrapper">
<div id="bkgcontainer"></div>
<div class="push"></div>
</div>
<footer>
<address>
<code omitted>
</address>
</footer>
</body>
</html>
我的CSS:
* {
margin: 0;
}
html, body{
height: 100%;
background-color: black;
}
#wrapper {
width: 100%;
position: relative;
min-height: 100%;
margin: 0px auto -25px;
}
footer, .push {
height: 25px;
}
#bkgcontainer {
width: 100%;
height: 100%;
position: relative;
margin: 0 auto -25px;
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
display: block;
}
footer{
text-align: center;
margin: 0px auto;
color: white;
position: relative;
}
至於我可以告訴大家,我把一切都定好了。但是當我啓動網站時,'bkgcontainer'佔據了整個屏幕,並且'-25'的下邊距低於視口。我無所適從,有什麼想法?修復或更好的方式,我都耳熟能詳。
是你能熔酚醛樹脂有你的問題嗎? – 2014-12-09 02:54:59
還沒有管理時間回到這個項目。我會在我回來後回覆。 – Cody 2014-12-09 15:39:22