简体   繁体   中英

what is the replacement for filter: progid:DXImageTransform.Microsoft.gradient

I'm using the following in my CSS (CSS3) file in order to create a gradient in Internet Explorer:

filter: progid:DXImageTransform.Microsoft.gradient

for example

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#C4D5FB', endColorstr='#DAE6FB'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#C4D5FB), to(#DAE6FB)); /* for webkit browsers */
background: -moz-linear-gradient(top,  #C4D5FB,  #DAE6FB); /* for firefox 3.6+ */

I have just read that it is deprecated since Internet Explorer 9 but still works. Is it safe to use it? is there a replacement for it?

according to: internet-explorer-9-gradients-with-rounded-corners

it is safe to use it:

Tools like the Ultimate CSS Gradient Generator generate the code needed for lovely CSS3 gradients with a fallback option for legacy Internet Explorer (using the gradient filter mentioned above).

thank you.

You can use the inset for box-shadow to by pass the gradient. I had this problem and just could not get it to work. So I saw this article http://www.sitepoint.com/shadow-boxing-image-free-css3-glossy-buttons/ . Worked great for me.

This is the code I used on my project.

border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;
box-shadow: 3px 3px 6px rgba(0, 0, 0, .2), 0px 0px 3px rgba(0, 0, 0, .1), inset 0px 5px 12px #930, inset 0px 15px 2px rgba(240, 150, 69, .5),inset 0px 25px 25px #930;

Try This site

http://www.colorzilla.com/gradient-editor/

Check the IE9 Support box. It will give you an SVG solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM