我正在尝试通过css添加渐变。
我在旧版本的ie。
中有渐变线filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#e4da9d, endColorstr=#c1b676);
然而,针对较少css的javascript解释器给出了该行的语法错误。有没有办法从解析中跳过该行,只是按原样输出。
答案 0 :(得分:6)
使用
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#e4da9d, endColorstr=#c1b676)";
更多关于“逃避”的信息 - String Functions - CSS Escaping