2014-02-12 74 views
1

http://apolytos.com/new/img/test.html背景固定&蓋 - Internet Explorer的11

<!doctype html> 
<html> 
<head> 
<meta charset="utf-8"> 
<style> 
body { 
    background:url("background.jpg"); 
    background-repeat:no-repeat; 
    background-attachment:fixed; 
    background-size: cover; 
    background-position:top center; 
    margin:0; 
} 
</style> 
</head> 
<body> 
</body> 
</html> 

的Internet Explorer 11未覆蓋;查看提供的鏈接。如果我刪除了:固定的,它會覆蓋原本應該的內容,但是bg會滾動頁面上的內容,這是不需要的。在IE中,這兩行代碼似乎有衝突。

+0

喲,你有一個的jsfiddle? –

+0

負面ghostrider – Robb

回答

0

試試這個代碼,它應該很好。

html { 
    background: url(images/bg.jpg) no-repeat center center fixed; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    background-size: cover; 
} 
+0

背景大小不需要前綴 –

+0

當你使用過時的瀏覽器 –

+0

沒有變化,仍然是相同的 – Robb

0

嘗試使用背景圖片更換濾芯,這意味着用作標籤

+0

你會舉一個例子嗎?我不完全跟着 – Robb

+0

試着把lyk image和.img {position:absolute;頂部:0;寬度:100%;高度:100%;} –