0

where do i put this stylecodes?

<radialGradient gradientUnits="objectBoundingBox" r="100%" cy="50%" cx="50%" id="rgrad_group_43">
   <stop style="stop-color:rgb(0, 255, 244); stop-opacity:1" offset="0%"/>
   <stop style="stop-color:rgb(0, 74, 255); stop-opacity:1" offset="90%"/>
   <stop style="stop-color:rgb(46, 60, 208); stop-opacity:1" offset="100%"/>
</radialGradient>

<style type="text/css">
svg rect { fill:transparent;}
svg g { fill:url(#rgrad_group_43); }
</style>

When i put the code in the body, no svgs on my page where styled. So i must put it into an SVG tag, right?

<svg>
<radialGradient gradientUnits="objectBoundingBox" r="100%" cy="50%" cx="50%" id="rgrad_group_43">
   <stop style="stop-color:rgb(0, 255, 244); stop-opacity:1" offset="0%"/>
   <stop style="stop-color:rgb(0, 74, 255); stop-opacity:1" offset="90%"/>
   <stop style="stop-color:rgb(46, 60, 208); stop-opacity:1" offset="100%"/>
</radialGradient>

<style type="text/css">
svg rect { fill:transparent;}
svg g { fill:url(#rgrad_group_43); }
</style>
</svg>

It works but is this correct/valid?
No version="1.1" , no xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" no viewBox="0 0 50 50" and no xml:space="preserve"

here is a demo
https://jsfiddle.net/qcmxryay/

Peter
  • 11,413
  • 31
  • 100
  • 152
  • 1
    Does this answer your question? http://stackoverflow.com/questions/18467982/are-svg-parameters-such-as-xmlns-and-version-needed/18468348#18468348 – Robert Longson Mar 12 '16 at 07:33

1 Answers1

-2

i don't sure if Works for you, but to me work, always i going to work with a SVG, i make the figure or anything in Illustrator and then i use the option export like SVG, so i don't need make that kind of changes.