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