<radial-gradient>:radial-gradient([ <position>,]? [ [ <shape> || <size> ] | <shape-size>{2},]? <color-stop>[, <color-stop>]+);
<position>:[ <length>① | <percentage>① | left | center① | right ]? [ <length>② | <percentage>② | top | center② | bottom ]?
<shape>:circle | ellipse
<size>:closest-side | closest-corner | farthest-side | farthest-corner | contain | cover
<shape-size>:<length> | <percentage>
<color-stop>:<color> [ <length> | <percentage> ]?
示例代码:
(图一)
radial-gradient(circle,#f00,#ff0,#080); radial-gradient(center,circle,#f00,#ff0,#080); radial-gradient(50%,circle,#f00,#ff0,#080); radial-gradient(circle,#f00 0%,#ff0 50%,#080 100%); radial-gradient(circle cover,#f00,#ff0,#080);
以上几句代码都可以实现如(图一)的渐变效果
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 |