2017-07-28 165 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幫助我 –

相關問題