`

css控制背景颜色渐变

阅读更多
/*-----------由左至右渐变-------------*/

body{ width:100%; height:105px; margin:0 auto;
filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#00108B,endcolorstr=white,gradientType=1);  /*IE*/
-ms-filter:progid:DXImageTransform.Microsoft.gradient(startcolorstr=#00108B,endcolorstr=white,gradientType=1);  /*IE8*/
background:white;   /* 一些不支持背景渐变的浏览器 */
background:-o-linear-gradient(left,#00108B 0%,white);  /*opera*/
background:-moz-linear-gradient(left, #00108B, white);  /*firefox*/
background:-webkit-gradient(linear, left top, right top, from(#00108B), to(rgba(0, 0, 255, 0)));}  /*chrome,safari*/
background:-ms-linear-gradient(left,  #00108B, white);}/*IE10*/




/*-----------由上至下渐变-------------*/


body{ width:100%; height:105px; margin:0 auto;
filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#00108B,endcolorstr=white,gradientType=0);  /*IE*/
-ms-filter:progid:DXImageTransform.Microsoft.gradient(startcolorstr=#00108B,endcolorstr=white,gradientType=0);  /*IE8*/
background:white;   /* 一些不支持背景渐变的浏览器 */
background:-o-linear-gradient(top,#00108B 0%,white);  /*opera*/
background:-moz-linear-gradient(top, #00108B, white);  /*firefox*/
background:-webkit-gradient(linear, 0 0, 0 500, from(#00108B), to(rgba(0, 0, 255, 0)));}  /*chrome,safari*/
background:-ms-linear-gradient(top,  #00108B, white);}/*IE10*/
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics