【问题标题】:Internet Explorer button CSSInternet Explorer 按钮 CSS
【发布时间】:2012-03-26 03:24:53
【问题描述】:

我使用渐变作为按钮背景颜色,这仅适用于非 IE 浏览器。我正在尝试为 IE 设置纯色背景色。当我将背景样式放在样式表中的背景渐变之前,它根本不显示。当我把它放在之后,它会覆盖所有浏览器中的渐变。

没有它,我的按钮是完全透明的。有人可以帮我弄清楚如何只为 IE 提供背景颜色吗? (版本 8 和 9)或者甚至更好.. 设置渐变?

这是在 IE 以外的浏览器中工作的 CSS。但是,纯色背景根本没有出现:

button {
        background: #3485bf;
    background: -moz-linear-gradient(
        top,
        #59a3d4 0%,
        #3485bf);
    background: -webkit-gradient(
        linear, left top, left bottom, 
        from(#59a3d4),
        to(#3485bf));
}

【问题讨论】:

    标签: css internet-explorer button internet-explorer-8 background-color


    【解决方案1】:

    尝试使用过滤器。像

    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#59a3d4', endColorstr='#3485bf');
    

    应该为你做这项工作。

    见Transitions and Filters

    【讨论】:

      【解决方案2】:

      此链接说明了如何让渐变在所有现代浏览器中工作,然后在旧浏览器上包括回退背景颜色:

      http://css-tricks.com/css3-gradients/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2010-09-25
        • 1970-01-01
        • 1970-01-01
        • 2016-11-05
        • 1970-01-01
        • 2013-09-13
        • 2013-12-12
        • 2011-10-08
        相关资源
        最近更新 更多