我在我的 css 文件的 body{} 中设置了主页的背景图片。这是我的第一个错误吗?
body{
background-image:url('img/bg-white.png');
width:100%;
height:100%;
margin: 0 auto;
}
我想为我的页脚创建一个背景图像。所以我将它添加到 CSS 的底部
#footer-background{
background-image:url('img/footer-background.jpg');
z-index:1;
}
它没有出现。是不是和原来的背景重叠了?或者还有更多?
最佳答案
这只是瞎猜,需要更多信息才能得出结论性答案,但可能是因为您没有为页脚指定高度或宽度。
#footer-background{
background-image:url('img/footer-background.jpg');
z-index:1;
height:200px;
width:100%;
}
关于CSS 页脚背景未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17847106/