FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#f2f2f2); /*IE旧版本*/
background: -ms-linear-gradient(top,#ffffff,#f2f2f2);/* IE 10 */
background:-moz-linear-gradient(top,#ffffff,#f2f2f2);/*火狐*/
background:-webkit-gradient(linear, 0% 0%, 0% 100%,from(#ffffff),to(#f2f2f2));/*谷歌*/
background: -webkit-linear-gradient(top, #ffffff, #f2f2f2);/*Safari5.1 Chrome 10+*/
background: -o-linear-gradient(top, #ffffff, #f2f2f2); /*Opera 11.10+*/
background: linear-gradient(left, #ffffff, #f2f2f2);
尽量将颜色用6位十六进制表示(从#ffffff上下渐变到#f2f2f2)
background: white; /* 为较旧的或者不支持的浏览器设置备用属性 */ background: -moz-linear-gradient(top, #dedede, white 8%); background: -webkit-gradient(linear, 0 0, 0 8%, from(#dedede), to(white)); border-top: 1px solid white;
只渐变8%
参考http://caibaojian.com/css3-background-gradient.html