我终于找到了一种方法,可以通过使用 background-size: cover
来缩小背景图像以覆盖整个屏幕,无论大小如何,但是突然出现的一个无法预料的问题是它完全隐藏了我的页脚在背景图片后面,因为背景图片位于页脚上方的 div 中。我试过使用 z-index
,但没有任何作用。所有代码都可以在 http://hanksmith.com/ 找到,具体在 http://hanksmith.com/css/index.css和 http://hanksmith.com/css/master.css .任何帮助将不胜感激!
最佳答案
在您删除 master.css
中的页脚 margin-top
时已解决。
试试这个:
.footer {
height: 200px;
margin-top: 0px;
}
关于html - 在背景大小 :cover 以下显示页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41235127/