這梯度使用SASS和Compass做到不以任何版本的Internet Explorer的工作:指南針背景圖片(線性漸變)不工作的IE
@include background-image(linear-gradient(left, rgba(241,236,236,0.95), rgba(241,236,236,0.9), rgba(241,236,236,0.85), rgba(241,236,236,0.8), rgba(241,236,236,0.75), rgba(241,236,236,0.4)));
它翻譯成這個CSS:
background-image: -webkit-gradient(linear, 0% 50%, 100% 50%, color-stop(0%, rgba(241, 236, 236, 0.95)), color-stop(20%, rgba(241, 236, 236, 0.9)), color-stop(40%, rgba(241, 236, 236, 0.85)), color-stop(60%, rgba(241, 236, 236, 0.8)), color-stop(80%, rgba(241, 236, 236, 0.75)), color-stop(100%, rgba(241, 236, 236, 0.4)));
background-image: -webkit-linear-gradient(left, rgba(241, 236, 236, 0.95), rgba(241, 236, 236, 0.9), rgba(241, 236, 236, 0.85), rgba(241, 236, 236, 0.8), rgba(241, 236, 236, 0.75), rgba(241, 236, 236, 0.4));
background-image: -moz-linear-gradient(left, rgba(241, 236, 236, 0.95), rgba(241, 236, 236, 0.9), rgba(241, 236, 236, 0.85), rgba(241, 236, 236, 0.8), rgba(241, 236, 236, 0.75), rgba(241, 236, 236, 0.4));
background-image: -o-linear-gradient(left, rgba(241, 236, 236, 0.95), rgba(241, 236, 236, 0.9), rgba(241, 236, 236, 0.85), rgba(241, 236, 236, 0.8), rgba(241, 236, 236, 0.75), rgba(241, 236, 236, 0.4));
background-image: linear-gradient(left, rgba(241, 236, 236, 0.95), rgba(241, 236, 236, 0.9), rgba(241, 236, 236, 0.85), rgba(241, 236, 236, 0.8), rgba(241, 236, 236, 0.75), rgba(241, 236, 236, 0.4));
那麼你用IE來解決這個問題呢?
我與Internet Explorer 11試井它,我需要它從IE9工作+
如幫助之下,我發現現在的答案,包括IE10 +,幫我:
background: -ms-linear-gradient(left, rgba(241,236,236,0.95), rgba(241,236,236,0.9), rgba(241,236,236,0.85), rgba(241,236,236,0.8), rgba(241,236,236,0.75), rgba(241,236,236,0.4)); /* IE10+ */
後我嘗試了以下爲IE9,但沒有工作:
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f1ecec', endColorstr='#fffafa',GradientType=1);
我可以用什麼來覆蓋惱人的IE9?
請指定您正在測試的IE版本,以及您需要它工作的版本。在早期的IE版本中,CSS漸變需要不同的語法。 – Spudley
@Spudley我加了我在這個問題上使用的版本。我需要它從IE9 + –