-1
所以,我有以下代码:停止,颜色CSS/SVG工作不
<?xml version="1.0" standalone="yes"?>
<svg xmlns="http://www.w3.org/2000/svg" width="360" height="240">
<style>stop{stop-opacity:1}circle{fill:url(#r)}</style>
<defs>
<radialGradient id="r" cx="50%" cy="50%" r="50%" fx="50%" fy="50%">
<stop offset="0%" style="stop-color:#ce1126"/>
<stop offset="17%" style="stop-color:#e5911d"/>
<stop offset="33%" style="stop-color:#fcd116"/>
<stop offset="50%" style="stop-color:#18c063"/>
<stop offset="67%" style="stop-color:#75aadb"/>
<stop offset="83%" style="stop-color:#803ac5"/>
<stop offset="100%" style="stop-color:#00335b"/>
</radialGradient>
</defs>
<circle cx="150" cy="300" r="55"/>
</svg>
有趣的是,如果我添加stop-color:attr(c)
到停止的CSS和相应的改动(style="stop-color:
=>c="
),它不起作用(或者至少不在Safari/iOS9中)。为什么是这样?
有趣的是,作为[本网站](http://www.w3schools.com/svg/svg_grad_radial.asp)使用内联样式的方法。我会给它一个镜头。 –
@SomePerson请不要使用“那个网站”使用更多的mozilla文档更新:https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Gradients – Persijn