Background gradients for IE: is #RRGGBB format required?

自闭症网瘾萝莉.ら 提交于 2019-12-11 10:18:48

问题


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 *Colorstrs 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.


回答1:


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.



来源:https://stackoverflow.com/questions/20984353/background-gradients-for-ie-is-rrggbb-format-required

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!