【问题标题】:How to use gradient css property that work for IE7?如何使用适用于 IE7 的渐变 css 属性?
【发布时间】:2014-03-27 20:39:32
【问题描述】:

我正在使用以下 CSS 来创建线性背景渐变。它似乎在 IE8、FF、Safari 和 chrome 中工作得很好,但在 IE7 中却不行。 IE7 显示白色背景。这是我的代码

body{
    background: -webkit-linear-gradient(left, #6D1C18 , #AF251B,#6D1C18); /* For Safari   5.1 to 6.0 */
    background: -o-linear-gradient(right, #6D1C18, #AF251B,#6D1C18); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(right, #6D1C18, #AF251B, #6D1C18); /* For Firefox 3.6 to 15 */
    background: linear-gradient(to right, #6D1C18 , #AF251B, #6D1C18); /* Standard syntax (must be last) */
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#6D1C18', EndColorStr='#AF251B')";
}

【问题讨论】:

标签: css wordpress


【解决方案1】:

正确的语法如下(示例),注意颜色的数字值是 8,而不是 6:

<div style="width:100%;height:100%;
filter: progid:DXImageTransform.Microsoft.gradient
(startColorstr=#550000FF, endColorstr=#55FFFF00)" >
<!-- All of your document elements go in here. -->
</div>

受 Microsoft Internet Explorer 4.0 及更高版本支持。请参阅 MSDN 源代码here

【讨论】:

    猜你喜欢
    • 2022-01-10
    • 2020-12-14
    • 2019-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-27
    • 2023-03-03
    相关资源
    最近更新 更多