<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 | 4-18 | 5.1.7 | 13-23 | 11.5-12.51 |
版本 | 10 | 11.6-12.5 |