SVG transparent background web

Gildas.Tambo picture Gildas.Tambo · Sep 2, 2013 · Viewed 91.2k times · Source

I am trying to change the background of this SVG code to transparent without success. I'm new to SVG and somehow I can't find the solution on google; can anybody help?

demo:http://jsfiddle.net/kougiland/SzfSJ/1/

Answer

Robert Longson picture Robert Longson · Sep 2, 2013

transparent is not part of the SVG specification, although many UAs such as Firefox do support it anyway. The SVG way would be to set the stroke to none, or alternatively set the stroke-opacity to 0.

You also don't set any value for fill on the <rect> element and the default is black. For a transparent rect you want to add fill="none".