<linear-gradient>:linear-gradient([ <point>,]? <color-stop>[, <color-stop>]+);
<point>:[ left | right ]? [ top | bottom ]? || <angle>?
<color-stop>:<color> [ <length> | <percentage> ]?
示例代码:
(图一)
linear-gradient(#fff,#333); linear-gradient(top,#fff,#333); linear-gradient(bottom,#333,#fff); linear-gradient(-90deg,#fff,#333);
以上几句代码都可以实现如(图一)的渐变效果
| 支持版本\类型 | IE | Firefox | Safari | Chrome | Opera | 
|---|---|---|---|---|---|
| 版本 | 6.0-9.0 | 4.0 | 5.1 | 13.0 | 11.50 | 
| 版本 | 10.0 | 
| 内核类型 | 写法 | 
|---|---|
| Webkit(Chrome/Safari) | -webkit-linear-gradient()/-webkit-gradient() | 
| Gecko(Firefox) | -moz-linear-gradient() | 
| Presto(Opera) | -o-linear-gradient() | 
| Trident(IE) | -ms-linear-gradient() | 
| W3C | linear-gradient() |