【发布时间】:2011-03-22 05:03:38
【问题描述】:
我一直在研究将图像保留在底部页面的解决方案。我目前得到的代码是:
.footer {
background-image: url('images/footer.png');
background-repeat: repeat-x;
position: absolute;
height: 950px;
width: 100%;
z-index: -101;
bottom: 0;
}
但是,这有问题。我的目标是贴在底部并显示在其他所有内容后面的背景(因此 z-index 较低)。我在顶部有以下代码(有一个中间,只是块颜色,刚刚添加到正文中):
.background {
position: absolute;
top: 0;
width: 100%;
height: 600px;
background-image: url('images/sky.png');
background-position: center;
background-repeat: repeat-x;
z-index: -100;
}
请注意:第一部分不起作用(不在底部),但第二部分起作用(在顶部)。
如果您想访问该网站,请随时访问:www.duffydesigns.co.uk/brough(请不要妄加判断,这是一项正在进行的工作,没有真正完成!)。
感谢您的帮助,
约瑟夫·达菲
注意:我相信你能猜到,上面是天空,下面是草和树。
【问题讨论】: