RGBa in Internet Explorer
I know that IE does not support RGBa. I also know that you can use the follow methods:
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filt开发者_如何学JAVAer: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
The first two Numbers in the "Colorstr" is the value for the opacity. with 99 being a .6 opacity. For other levels of opacity what are the number values? I cannot find them. Is there a simple way to calculate the number for opacity? Or where can I find those values?
Thanks =>
Looks like it's straight 1-byte hexadecimal, so just do this
Say your opacity is 30%:
.30 * 255 = 76.5
76 -> hex = 4C
You can convert decimal to hex using a variety of desktop tools, online pages, or this JS function:
new Number(76).toString(16);
It's a hexidecimal 99 which is 153 in decimal. type 0x99 in a js console and it will spit out 153. F is the highest digit in hex so typing in 0xff (the highest value for two hex digits) will give you 255. if 255 is 100% and 153 is the value you want to know the percentage of you divide 153 by 255 which results in 0.6.
sure, use a hex to percentage converter like this:
#999999
converts to rgb(60%, 60%, 60%) so 99 = 60%
#BABABA
converts to rgb(73%, 73%, 73%) so BA = 73%
you can probably find a better hex converter than the one I've suggested. Remember that hex is base 16, not 10...
As of March 2011, Internet Explorer 9+ DOES process rgba correctly, and, in fact, does so more accurately/thoroughly than [Chrome|Mozilla|Safari]...
精彩评论