2017-07-28 39 views
0

我是编程新手,我为朋友制作了我的第一个网站。 www.goalstars.be但显然登陆页面的背景图片不起作用尝试了这里发布的解决方案,但似乎没有解决它。我正在墙上奔跑。我想我在某个地方犯了一个大错。 希望有人能帮助我。在此先感谢背景图片不适用于Safari浏览器

这是CSS代码,我使用的标题

header { 

    background-image: url('img/landing.jpg'); 
    background-repeat: no-repeat; 
    background-size: cover; 
    background-position: center; 
    height: 100vh; 
    background-attachment: fixed; 
    border-bottom: solid 1px #00AB1C; 
    z-index: -1; 
} 
+0

[iOS的Safari浏览器不支持'背景附件:fixed'](http://caniuse.com/#feat=background-attachment) – Blazemonger

+0

@Rob他们的斗争'的话,pardner。 – Blazemonger

+0

@Blazemonger HTML和CSS是文档标记,而不是编程。 – Rob

回答

1

我与Safari浏览器同样的问题,所以我去除负的z-index和工作对我来说

+0

我原来的代码是没有z-index然后我搜索stackoverflow,我看到加入z-index会修复它,太糟糕了没有 –

0

尝试下面的CSS代码

<style type="text/css"> 
header { 
    background:url("img/landing.jpg") no-repeat scroll right top #000000; 
    -o-background-size: cover; 
    -moz-background-size: cover; 
    -webkit-background-size:cover; 
    background-size: cover; 
    background-attachment: fixed; 
    height: 100vh; 
    border-bottom: solid 1px #00AB1C; 
    z-index: -1; 
} 
</style> 
+0

没有工作:s视觉工作室也说不知道CSS属性。我alswo安装了一个自动前缀并在整个文档中使用它。但thx帮助我 –

相关问题