首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

css统制背景颜色渐变

2013-07-08 
css控制背景颜色渐变/*-----------由左至右渐变-------------*/body{ width:100% height:105px margin: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*/

热点排行