如何使用Modernizr检测css模糊支持?

时间:2017-02-15 14:17:01

标签: modernizr

如何检测浏览器是否支持css模糊?

我可以使用Modernizr放入html标签的任何默认类吗?

borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions

我需要禁用所有模糊(或启用)css模糊到css中仅支持的浏览器。谢谢

1 个答案:

答案 0 :(得分:0)

如果您转到:https://modernizr.com/download?setclasses,然后选择CSS过滤器,您将看到以下示例:

CSS

.no-cssfilters .box { color: red; }
.cssfilters .box { color: green; }

JS

if (Modernizr.cssfilters) {
  // supported
} else {
  // not-supported
}

我相信这就是你所需要的。

相关问题