zum Beispiel haben wir defs und rect getrennt, so müssen wir IDSVG widthout mit IDs
<defs>
<linearGradient id="MyGradient">
<stop offset="0%" stop-color="#000" />
<stop offset="100%" stop-color="#fff" />
</linearGradient>
</defs>
<rect x="0" y="0" width="256" height="32" fill="url(#MyGradient)"/>
verwenden Wie kann ich das Gleiche tun, aber ohne ID zu verwenden (MyGradient). Vielleicht mit JavaScript?
so etwas wie diese
<rect x="0" y="0" width="256" height="32">
<linearGradient>
<stop offset="0%" stop-color="#000" />
<stop offset="100%" stop-color="#fff" />
</linearGradient>
</rect>
funktioniert nicht :(
Dies wäre (grob) in XAML möglich, aber nicht in SVG. – Joey