01 整站变灰特效
css 代码
指定了 filter 样式,应用该元素的子元素的 fixed 和 absolute 定位可能会出错,可以将 filter 样式应用到 html 标签中来解决。 原因:对于指定了 filter 样式且值不为 none 时,被应用该样式的元素其子元素中如果有 position 为 absolute 或 fixed 的元素,会为这些元素创建一个新的容器,使得这些绝对或固定定位的元素其定位的基准相对于这个新创建的容器。
body {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
filter: grayscale(100%);
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); /* ie */
filter: gray; /* ie6~ie9 */
}
支持 IE 10 和 IE 11 的 hack
强制使用 IE 8 来渲染页面
<meta http-equiv="X-UA-Compatible" content="IE=8">
最后更新于
这有帮助吗?