1 <svg version=
"1.1" xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink">
3 <linearGradient id=
"gradient1">
4 <stop offset=
"0" stop-color=
"red"/>
5 <stop offset=
"1" stop-color=
"green"/>
8 <radialGradient id=
"gradient2" gradientUnits=
"userSpaceOnUse" cx=
"0" cy=
"0" r=
"9">
9 <stop offset=
"0" stop-color=
"red" />
10 <stop offset=
"1" stop-color=
"red" stop-opacity=
"0" />
14 <!-- Gradients with objectBoundingBox units can't be applied to 1d objects -->
15 <line x1=
"20" x2=
"220" y1=
"50" y2=
"50" stroke=
"url(#gradient1) #0f0" stroke-width=
"20"/>
17 <!-- Gradients with userSpaceOnUse units can be applied to 1d objects -->
18 <g transform=
"translate(120, 100)">
19 <line x1=
"-9" y1=
"0" x2=
"9" y2=
"0" stroke=
"url(#gradient2)" />
20 <line x1=
"0" y1=
"-9" x2=
"0" y2=
"9" stroke=
"url(#gradient2)" />
21 <line x1=
"-9" y1=
"0" x2=
"9" y2=
"0" stroke=
"url(#gradient2)" transform=
"rotate(45)" />
22 <line x1=
"-9" y1=
"0" x2=
"9" y2=
"0" stroke=
"url(#gradient2)" transform=
"rotate(-45)" />
25 <text x=
"140" y=
"150" text-anchor=
"middle">You should see a green line, and a red star
</text>