线性渐变的兼容写法
2016-03-03 17:16
330 查看
线性渐变的兼容写法如下:
ie 滤镜:filter
linear-gradient 在 ie9 以下是不支持的,所以对于 ie6 - ie8 我们可以使用滤镜来解决,代码如下:
由于 filter 是 ie 的私有属性,所以我们需要针对 ie9 单独处理滤镜效果,代码如下:
.gradient{ background: #000000; background: -moz-linear-gradient(top, #000000 0%, #ffffff 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#000000), color-stop(100%,#ffffff)); background: -webkit-linear-gradient(top, #000000 0%,#ffffff 100%); background: -o-linear-gradient(top, #000000 0%,#ffffff 100%); background: -ms-linear-gradient(top, #000000 0%,#ffffff 100%); background: linear-gradient(to bottom, #000000 0%,#ffffff 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#ffffff',GradientType=0 ); } :root .gradient{filter:none;}
ie 滤镜:filter
linear-gradient 在 ie9 以下是不支持的,所以对于 ie6 - ie8 我们可以使用滤镜来解决,代码如下:
.gradient{ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#ffffff',GradientType=0 ); }
由于 filter 是 ie 的私有属性,所以我们需要针对 ie9 单独处理滤镜效果,代码如下:
:root {filter:none;}
相关文章推荐
- 深入浅出RPC框架(上)
- K近临算法(KNN)
- 量化交易 ,金融策略的基础!
- 【java学习笔记】for增强循环
- HDU 1846 Brave Game 巴士博弈
- iPhone 6 / 6 Plus 设计·适配方案
- 不用Ubuntu,自己动手下载Android源码
- GridView的属性
- 线段树求逆序数方法 HDU1394&&POJ2299
- 正则表达式(包含与不包含)
- mysql合并相同字段,不同的拼接在起后
- webUploader上传组件 实际运用小结
- Tomcat各种内存溢出解决办法总结
- JAVA的StringBuffer类
- linux下Drools6.3.0规则引擎的安装配置
- Java对象克隆——浅克隆和深克隆的区别
- tomcat部署web项目的3中方法
- 初识spring之quartz定时调度
- 用workspace管理工程,并解决多静态库依赖
- java 字符串缓冲池 String缓冲池