0

我發現很多關於IE9不渲染背景圖像的問題,但找不到適合我需求的解決方案。IE9不渲染背景圖像

我爲我的背景使用了一個CSS3漸變發生器,對於除IE9以外的所有現代瀏覽器都適用。

使用的代碼IM是:

body { 
background-size: cover; 
background-repeat: no-repeat; 
background-image: linear-gradient(bottom, rgb(184,190,227) 49%, rgb(118,135,250) 80%); 
background-image: -o-linear-gradient(bottom, rgb(184,190,227) 49%, rgb(118,135,250) 80%); 
background-image: -moz-linear-gradient(bottom, rgb(184,190,227) 49%, rgb(118,135,250) 80%); 
background-image: -webkit-linear-gradient(bottom, rgb(184,190,227) 49%, rgb(118,135,250) 80%); 
background-image: -ms-linear-gradient(bottom, rgb(184,190,227) 49%, rgb(118,135,250) 80%); 
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0.49, rgb(184,190,227)),color-stop(0.8, rgb(118,135,250))); 
} 

伊夫設置好的一個的jsfiddle頁:http://jsfiddle.net/nUA98/

所以,如果有人知道它爲什麼不是在IE9工作,評論/答覆將不勝感激。

謝謝。

+1

caniuse.com是一個非常有用的資源:CSS漸變(http://caniuse.com/#feat=css-gradients) – Stefan

+0

@Stefan看起來像完整的資源,把它放在我的最愛中,太棒了! –

回答

2

這不是說IE9不渲染背景圖像,只是如果你想在IE9中使用漸變,你必須使用SVG。使用ColorZilla創建梯度,並確保在最後檢查「IE9支持」選項。它會自動生成一個data-uri SVG供您使用,而不必實際使用圖像文件。

+0

我會在這裏看看,thx –

+0

很好地工作!謝謝 –

1
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff', endColorstr='#f2f2f2'); 
+0

似乎工作,但不是爲IE8? –

+0

是的,但也適用於IE9 :) – Morpheus

+0

好的非常感謝你 –

0

IE9將不支持RGBA格式,所以試試這個
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f8cbd6', endColorstr='#edeeec',GradientType=0); /* IE6-9 */