SVG transparent background web
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"
.
Inside rectangle you can use fill-opacity="0.5"
<rect x="0" y="0" width="300" height="100" stroke="transparent" stroke-width="1" fill="green" fill-opacity="0.5" />