<style type="text/css"> .linear{ width:100%; height:600px; FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#b8c4cb,endColorStr=red); /*IE 6 7 8*/ background: -ms-linear-gradient(top, #fff, #0000ff); /* IE 10 */ background:-moz-linear-gradient(top,#b8c4cb,#f6f6f8);/*火狐*/ background:-webkit-gradient(linear, 0% 0%, 0% 100%,from(#b8c4cb), to(#f6f6f8));/*谷歌*/ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#0000ff)); /* Safari 4-5, Chrome 1-9*/ background: -webkit-linear-gradient(top, #fff, #0000ff); /*Safari5.1 Chrome 10+*/ background: -o-linear-gradient(top, #fff, #0000ff); /*Opera 11.10+*/ } </style> <body> <div class="linear"></div> </body>
google模式下:css
ie模式下:html
火狐模式下:css3
FILTER(ie模式);background:-moz-linear-gradient(火狐模式);background:-webkit-gradient(谷歌模式)。web
以上是爲了區別不一樣瀏覽器的不一樣效果,我把色碼區別開了。爲了兼容全部瀏覽器的相同效果的css3漸變色,你能夠把色碼調試成同樣。瀏覽器
文章來自:https://jingyan.baidu.com/article/8065f87fed4a3f233124989c.htmlgoogle