XML technologies / SVG / Filters, transformations and gradients / Defining and assigning gradients / Finishing the button

(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)

The awkward position within the graphic is still a problem. Group its individual elements and position them relative to the group’s origin. You can then move the group to any desired point in the graphic.

<?xml version="1.0" standalone="no"?>
...
<svg width="500" height="500">
  <radialGradient id="runderVerlauf" cx="50%" cy="90%" r="60%" fx="60%" fy="80%">
    ...
  </radialGradient>
  <linearGradient id="linearerVerlauf" gradientTransform="rotate(90)">
    ...
  </linearGradient>
  <g transform="translate(20,20)">
    <circle cx="25" cy="25" r="25" style="stroke-width:1;stroke-opacity:0.8;stroke:rgb(222,0,0);opacity:1;fill:url(#runderVerlauf)"/>
    <ellipse cx="25" cy="15" rx="20" ry="12" style="stroke-width:1;stroke:none; opacity:1;fill:url(#linearerVerlauf)"/>
  </g>
</svg>

   

 

 

 

back to top