我們無法在IE中正確顯示漸變。以下HTML在Chrome和其他瀏覽器中很好地顯示了漸變,但在IE中顯示爲幾乎純藍色。將不勝感激幫助!在IE中顯示漸變
<HTML>
<HEAD>
<STYLE type="text/css">
body {
/* Old browsers */
background: #1e5799;
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzFlNTc5OSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjI0JSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjcyJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM3ZGI5ZTgiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
/* FF3.6+ */
background: -moz-linear-gradient(top, #1e5799 0%, #ffffff 24%, #ffffff 72%, #7db9e8 100%);
/* Chrome,Safari4+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(24%,#ffffff), color-stop(72%,#ffffff), color-stop(100%,#7db9e8));
/* Chrome10+,Safari5.1+ */
background: -webkit-linear-gradient(top, #1e5799 0%,#ffffff 24%,#ffffff 72%,#7db9e8 100%);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #1e5799 0%,#ffffff 24%,#ffffff 72%,#7db9e8 100%);
/* IE10+ */
background: -ms-linear-gradient(top, #1e5799 0%,#ffffff 24%,#ffffff 72%,#7db9e8 100%);
/* W3C */
background: linear-gradient(top, #1e5799 0%,#ffffff 24%,#ffffff 72%,#7db9e8 100%);
/* IE6-8 */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0);
}
</style>
</HEAD>
<BODY>
<H1 >Testing Blue Gradient</H1>
</BODY>
</HTML>
只是說明說的MS語法不正確,現在。 IE10的最終版本使用CSS漸變的最新語法,並且不需要前綴。 ms前綴版本應該被刪除,並且W3C版本應該被更新爲: 背景:linear-gradient(至底部,#1e5799,#7db9e8); 注意「到底」而不是頂部。方向已翻轉成最新的語法,並且要求前面有to關鍵字。 –