我在完成网站主页时遇到了一些麻烦。
如果你去主页它看起来应该是怎么回事,但是当你向下滚动到页脚时,主要背景如下,啤酒瓶也是如此。我只是希望这些东西能够保持原样,啤酒瓶就在它被切断的页脚顶部。
的CSS:
body{
height: 100%;
width: 100%;
background-color: #b2b2b2;
background: url(../images/trial3.gif) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
/*HERE iS BOTTLE IMAGE */
.smoke {
position: fixed;
bottom: 0;
right: 0;
}
#footer{
height: 125px;
background: #333333;
width: 100%;
overflow:auto;
}
答案 0 :(得分:1)
只需从您的fixed
媒体资源和background
课程中删除.smoke
一词。
我想我明白了。我正在运行Chrome,我在Firefox 15和IE8中尝试过。当您将position:absolute
添加到.smoke
课程并position:relative
添加到#footer
div时,它们似乎都按照您要求的方式工作。
您可以使用我的jsFiddle here和here's the result。
答案 1 :(得分:0)
如果您将position:relative
放在#main DIV
上并将width:1350px
更改为width:100%
,那么这也会解决您的垂直滚动条问题!