CSS实现背景色渐变

一、使用CSS3属性

/* for firefox */
background-image: -moz-linear-gradient(top,#fefefe,#ebebeb);
/* for webkit core */
background-image: -webkit-gradient(linear,0 0,0 100%,from(#fefefe),to(#ebebeb));

二、IE9- 兼容性写法

/* for IE6,7,8,9 */
filter: progid:DXImageTransform.Microsoft.gradient(
  startcolorstr=#fefefe,
  endcolorstr=#ebebeb,
  gradientType=0
);

参数:上面的滤镜代码主要有三个参数,依次是:

@ startcolorstr   :    gradientType=1代表横向渐变,gradientType=0代表纵向淅变

@ endcolorstr    :    startcolorstr=”色彩” 代表渐变渐变起始的色彩

@ gradientType  :    endcolorstr=”色彩” 代表渐变结尾的色彩

more information you can click here URL

评论

暂无评论