IE的背景渐变:是#RRGGBB格式要求? [英] Background gradients for IE: is #RRGGBB format required?
问题描述
我发现很多网站都解释应该使用IE渐变:
.IEGradient {
filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 0,startColorstr ='#AAAAAA',endColorstr ='#BBBBBB');
}
但是因为我需要能够接受直接输入的颜色用户,我想知道这些 * Colorstr
是否仅限于 #RRGGBB
格式,或者如果其他格式如 #RGB
或 rgb(r,g,b)
等也可以工作。我试过谷歌搜索答案,但我找不到任何网站说长的HEX格式是必需的,但我只是不断发现越来越多的网站,所有只是使用长十六进制格式,没有使用任何其他格式,所以让我很奇怪。
顺便说一下,msdn说 #AARRGGBB
格式为必填,但足够的网站不包含 AA
部分,所以仍然让我想知道其他格式是否会工作,如果在msdn上没有提到的格式也可以工作。
<我刚刚在IE11的开发工具中找到了仿真选项卡,显然你可以模拟到IE5那里。事实证明,只有
#AARRGGBB
和 #RRGGBB
格式是允许的。任何其他格式都会使其呈现蓝到黑的渐变。 I've found a lot of sites that explain that an IE gradient should be made using:
.IEGradient {
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#AAAAAA', endColorstr='#BBBBBB');
}
but since I would need to be able to accept the direct input of colours by users, I'd like to know if these *Colorstr
s are limited to just the #RRGGBB
format, or if other formats such as #RGB
or rgb(r, g, b)
etc. would also work. I've tried googling for answers, but I couldn't find any site saying the long HEX format was required, but I just kept finding more and more sites that all just used the long hex format, and none that used any other formats, so that made me wonder.
By the way, msdn says #AARRGGBB
format is required, yet there are enough sites that don't include the AA
part, so that still makes me wonder if other formats would work, if the format that isn't mentioned on msdn also works.
I've just found the emulation tab in IE11's dev tools, and apparently you can emulate down to IE5 there. It turns out that indeed only the #AARRGGBB
and #RRGGBB
formats are allowed. Any other format causes it to render a blue-to-black gradient.
这篇关于IE的背景渐变:是#RRGGBB格式要求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!