当前位置: 代码迷 >> HTML/CSS >> css统制背景颜色渐变
  详细解决方案

css统制背景颜色渐变

热度:121   发布时间:2013-07-08 14:13:00.0
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*/




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


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*/
  相关解决方案