How to apply -webkit-gradient to IE?

前端 未结 4 1008
北荒
北荒 2021-01-03 10:09

I have the following css code:

-webkit-gradient(linear, left bottom, left top, from(#5AE), to(#036));

Which displays the background very ni

4条回答
  •  我在风中等你
    2021-01-03 10:37

    The CSS3 PIE documentation has this example for linear gradients:

    #myElement {
        background: #CCC; /*fallback for non-CSS3 browsers*/
        background: -webkit-gradient(linear, 0 0, 0 100%, from(#CCC) to(#EEE)); /*old webkit*/
        background: -webkit-linear-gradient(#CCC, #EEE); /*new webkit*/
        background: -moz-linear-gradient(#CCC, #EEE); /*gecko*/
        background: -ms-linear-gradient(#CCC, #EEE); /*IE10*/
        background: -o-linear-gradient(#CCC, #EEE); /*opera 11.10+*/
        background: linear-gradient(#CCC, #EEE); /*future CSS3 browsers*/
        -pie-background: linear-gradient(#CCC, #EEE); /*PIE*/
        behavior: url(PIE.htc);
    }
    

    You are missing the -pie-background property.

    As an aside, you should use the "new webkit" syntax instead of the one you currently have; it's been quite a while since Webkit abandoned it.

提交回复
热议问题