2013-09-02 24 views
23

Bu SVG kodunun arka planını başarılı olmaksızın değiştirmeye çalışıyorum. SVG için yeniyim ve bir şekilde google'da çözümü bulamıyorum; kimse yardım edebilir mi?SVG şeffaf arka plan web

demo: Firefox gibi birçok UAs yine de desteklememize rağmen http://jsfiddle.net/kougiland/SzfSJ/1/

<svg xmlns="http://www.w3.org/2000/svg" width="300px" height="100px" viewBox="0 0 300 100"> 
    <rect x="0" y="0" width="300" height="100" stroke="transparent" stroke-width="1" /> 
    <circle cx="0" cy="50" r="15" fill="blue" stroke="transparent" stroke-width="1"> 
     <animateMotion 
     path="M 0 0 H 300 Z" 
     dur="3s" 
     repeatCount="indefinite" 
     /> 
    </circle> 

    <circle id="rotatingBall" cx="0" cy="50" r="15" fill="green" stroke="transparent" stroke-width="1" opacity="0.8"></circle> 
    <animateTransform 
     xlink:href="#rotatingBall" 
     attributeName="transform" 
     begin="0s" 
     dur="2s" 
     type="rotate" 
     from="0 20 20" 
     to="360 100 60" 
     repeatCount="indefinite" 
     /> 
</svg> 

cevap

24

şeffaf, SVG özelliklerinin bir parçası değildir. SVG yolu, stroke'u none'a ayarlamak veya stroke-opacity'u 0'a ayarlamaktır.

Ayrıca, <rect> öğesinde doldurma için herhangi bir değer ayarlamazsınız ve varsayılan değer siyahtır. Şeffaf bir rect için fill="none"'u eklemek istiyorsunuz.

İlgili konular