我在这一块上撞墙。我正在设计一个登录页面,其中有一个全屏幕图片背景,停在页脚处。所以基本上我相信我的麻烦在于创建一个粘脚。全屏幕图片背景 - 页脚室
我一直在关注教程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