Linear Gradient background in IE 7 - 9

China☆狼群 提交于 2019-11-30 19:25:22

问题


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 );
    }

回答1:


Your hex values are wrong for the IE6-9 part:

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


来源:https://stackoverflow.com/questions/16335754/linear-gradient-background-in-ie-7-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!