<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-9 #1 | 4.0-15.0 -moz- | 4.0-6.0 -webkit- | 4.0-25.0 -webkit- #2 | 15.0 |
10.0 | 16.0 | 6.1 | 26.0 |