线性渐变背景在IE 7 - 9 [英] Linear Gradient background in IE 7 - 9

查看:100
本文介绍了线性渐变背景在IE 7 - 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个复选框和一个标签风格,取决于复选框是否被选中。到目前为止,我使用[selectivizr]脚本 1 管理:selected 在IE7中正常工作。但不知何故渐变不是工作在IE 7,8和9的助手。应该有一个渐变从浅到深绿色,但我得到一个深蓝色渐变。我不能解释这个奇怪的行为,也许它与css规则的顺序有关系。

I have a checkbox and a Label to style, depending whether the checkbox is checked. So far I used the [selectivizr] script 1 to manage :selected propperty working in IE7. But somehow The Gradient is not working propper in IE 7, 8 and 9. There should be a Gradient from light to darker green, but I get a deep blue gradient. I can't explain this strange behavoir, maybe it has something to do with the order of css-rules?

     input[type=checkbox]:checked + label {
        background: #00bf00;
        background: -webkit-linear-gradient(top, #00bf00 0%, #009400 100%);
        background: -moz-linear-gradient(top, #00bf00 0%, #009400 100%);
        background: -o-linear-gradient(top, #00bf00 0%, #009400 100%);
        background: -ms-linear-gradient(top, #00bf00 0%, #009400 100%);
        background: linear-gradient(top, #00bf00 0%, #009400 100%); 
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222', endColorstr='#45484d',GradientType=0 ); /* EDIT: UPDATE BELOW:*/
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00bf00', endColorstr='#009400',GradientType=0 );
    }


推荐答案

IE6-9部分:

filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00bf00', endColorstr='#009400',GradientType=0 ); /* IE6-9 */

这篇关于线性渐变背景在IE 7 - 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆