你可以在使用Internet Explorer的过滤器属性生成的渐变中使用rgba颜色吗? [英] Can you use rgba colours in gradients produced with Internet Explorer’s filter property?
问题描述
Internet Explorer的过滤器
CSS属性(来自IE 8的 -ms-filter
)允许您执行CSS渐变,有点像 -webkit-gradient
和 -moz-gradient
属性(参见例如question 213750 )。
Internet Explorer’s filter
CSS property (-ms-filter
from IE 8) allows you to do CSS gradients, a bit like the -webkit-gradient
and -moz-gradient
properties (see e.g. question 213750).
但是,语法doesn' t似乎允许rgba颜色,所以你不能做一个渐变从一个颜色到透明。
However, the syntax doesn’t seem to allow for rgba colours, so you can’t do a gradient from a colour to transparent.
有任何方法来实现渐变,结束在透明度在IE ?
Is there any way to achieve gradients that end in transparency in IE?
推荐答案
停止颜色可以在 #AARRGGBB
符号中指定,其中 AA
表示alpha。例如,#ffff0000
是完全不透明的红色。
Stop colors can be specified in #AARRGGBB
notation, where AA
represents the alpha. For example, #ffff0000
is fully-opaque red.
这会产生100%的红色到50%渐变:
This produces a 100% red to 50% black horizontal gradient:
filter: progid:DXImageTransform.Microsoft.Gradient(
GradientType=1,
StartColorStr='#ffff0000',
EndColorStr='#80000000'
);
这篇关于你可以在使用Internet Explorer的过滤器属性生成的渐变中使用rgba颜色吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!