Css渐变
background-image: linear-gradient(#444, #111); background-image: linear-gradient(颜色值,颜色值);
linear-gradient(线性渐变)
radial-gradient(径向渐变)
Mozilla
background:-moz-linear-gradient( top,#ccc,#000);
*第一个参数是:线性渐变的方向;
*第二个参数和第三个参数是:开始和终止的颜色;
Webkit
background:-webkit-gradient(linear,center top,center bottom,from(#ccc), to(#000));
*第一个参数是:线性渐变的类型;
*第二个参数和第三个参数是:开始和终止的颜色;
Opera
background: -o-linear-gradient(top,#ccc, #000);
实战案例:
background:-moz-linear-gradient(left,#ace,#f96); /*Mozilla*/ background:-webkit-gradient(linear,0 50%,100% 50%,from(#ace),to(#f96)); background:-webkit-linear-gradient(left,#ace,#f96); background:-o-linear-gradient(left,#ace,#f96); /*Opera11*/
人如代码,规矩灵活;代码如诗,字句精伦。