CSS (perhaps with Compass): Cross-browser gradient

后端 未结 3 1052
梦毁少年i
梦毁少年i 2020-12-29 11:02

I would like to get a gradient in CSS (perhaps through Compass) that works in every major browser, including IE7+. Is there an easy way to do this (without writing a lot of

3条回答
  •  清歌不尽
    2020-12-29 11:51

    The code I use for all browser gradients..

                background: #0A284B;
                background: -webkit-gradient(linear, left top, left bottom, from(#0A284B), to(#135887));
                background: -moz-linear-gradient(top, #0A284B, #135887);
                background: -o-linear-gradient(#0A284B, #135887);
                filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0A284B', endColorstr='#135887');
                zoom:1;
    

    You will need to specify a height or zoom:1 to apply hasLayout to the element for this to work in ie

提交回复
热议问题