Internet Explorer 中的 RGBa
我知道IE不支持RGBa。我还知道您可以使用以下方法:
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
“Colorstr”中的前两个数字是不透明度的值。 99 是 0.6 的不透明度。对于其他级别的不透明度,数值是多少?我找不到他们。有没有一种简单的方法来计算不透明度的数字?或者我在哪里可以找到这些值?
谢谢=>
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-filter: "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 =>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
看起来像是直接的 1 字节十六进制,所以就这样做吧
假设你的不透明度是 30%:
你可以使用各种桌面工具、在线页面或这个 JS 函数将十进制转换为十六进制:
Looks like it's straight 1-byte hexadecimal, so just do this
Say your opacity is 30%:
You can convert decimal to hex using a variety of desktop tools, online pages, or this JS function:
它是十六进制的 99,十进制的 153。在 js 控制台中输入 0x99,它会输出 153。F 是十六进制的最高数字,因此输入 0xff(两个十六进制数字的最高值)将为您提供 255。如果 255 是 100%,而 153 是您想要的值要知道您的百分比,将 153 除以 255,结果为 0.6。
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.
当然,使用十六进制到百分比转换器,例如这个:
#999999< /code> 转换为 rgb(60%, 60%, 60%),因此 99 = 60%
#BABABA
转换为rgb(73%, 73%, 73%) 所以 BA = 73%您可能会找到比我建议的更好的十六进制转换器。请记住,十六进制是以 16 为底,而不是 10...
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...
截至 2011 年 3 月,Internet Explorer 9+ 确实可以正确处理 rgba,而且事实上,比 [Chrome|Mozilla|Safari] 更准确/彻底...
As of March 2011, Internet Explorer 9+ DOES process rgba correctly, and, in fact, does so more accurately/thoroughly than [Chrome|Mozilla|Safari]...