要在Internet Explorer中创建一个线性渐变,我曾经采用这个(可怕的)代码:
filter:progid:DXImageTransform.Microsoft.gradient(startColorStr =’#282828′,EndColorStr =’#185976′);
我不知道有没有存在一种使用过滤器和DXImageTransoform创建径向渐变的方法?
解决方法
Live Demo
#element{ background: #fff; /* The color you want for the radial gradient */ width:100px; height:100px; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100,finishopacity=0,style=2); }
径向梯度
For the Radial Gradient we have to create a div-elements. This element is a Overlay for the background. Than we’ll use the Alpha-Filter. Alpha will make this element transparent in a special style. style=2 is a radial alpha. This means that the center of the element will be full colored (opacity=100) and the opacity will lose to the edges (finishopacity=0)