大多数的兼容性问题都是由于低版本的IE浏览器所导致的,本章节分享一段代码实例,它能够实现背景的颜色的渐变效果,如果在标准浏览器中直接采用css3属性即可实现,但是IE低版本的问题所以需要进行一下兼容性处理。
代码如下:
蚂蚁部落 .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); width:300px; height:100px; margin:0px auto;}:root .gradient{filter:none;}
查看更多关于兼容低版本IE浏览器的背景颜色渐变效果_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did110631