Question

Im confused about stroke and fill defaults in SVG.

in the SVG spec (http://www.w3.org/TR/SVG/painting.html#StrokeProperty) it says the initial value for the stroke property is none - which i am guessing is transparent? and the default stroke width is 1. and default stroke-opacity should be 1 too

Similarly for filll (http://www.w3.org/TR/SVG/painting.html#FillProperty) the default should be black and opacity 1

Inkscape, and browsers seems to assume stroke = black and fill is transparent though - is that right? Does any one know what the defaults should be? and my rendered SVG seems to be at odd whith what browser and inkscape show...

Was it helpful?

Solution

stroke=none means no stroke at all, which is slightly different from just being transparent (stroke=<any color> combined with stroke-opacity=0 is what I would consider transparent).

The spec says what the defaults are for fill and stroke. I haven't seen any svg viewer that gets that wrong so far. Do you have an example svg?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top