IE9 gradient + image

2019-04-15 10:38发布

问题:

I want to use the filter CSS property for both a gradient and an image. I found and tried something like the following:

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/Controls/Calendar/Events/email.png'), progid:DXImageTransform.Microsoft.gradient( startColorstr='#D9D9D9', endColorstr='#989898',GradientType=0 ); /* IE6-9 */

the problem is that only 1st part of the filter applies. Does anyone know how to do it?

回答1:

According to the Microsoft Developer Network, you can "apply multiple filters", by separating them with spaces.

Using the following code (no comma between the two filters) should work:

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/Controls/Calendar/Events/email.png') progid:DXImageTransform.Microsoft.gradient( startColorstr='#D9D9D9', endColorstr='#989898',GradientType=0 ); /* IE6-9 */