CSS清理定位

时间:2013-02-27 14:53:06

标签: html css css3 positioning

我在完成网站主页时遇到了一些麻烦。

网站:www.crookednosebeer.com

如果你去主页它看起来应该是怎么回事,但是当你向下滚动到页脚时,主要背景如下,啤酒瓶也是如此。我只是希望这些东西能够保持原样,啤酒瓶就在它被切断的页脚顶部。

的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;
}

2 个答案:

答案 0 :(得分:1)

只需从您的fixed媒体资源和background课程中删除.smoke一词。

修改

我想我明白了。我正在运行Chrome,我在Firefox 15和IE8中尝试过。当您将position:absolute添加到.smoke课程并position:relative添加到#footer div时,它们似乎都按照您要求的方式工作。

您可以使用我的jsFiddle herehere's the result

答案 1 :(得分:0)

如果您将position:relative放在#main DIV上并将width:1350px更改为width:100%,那么这也会解决您的垂直滚动条问题!