0

If I had an SVG image like this:

<img src="image.svg">

Would there be some sort of attribute that I can implement to main the SVG's stroke weight? Something like this:

<img src="image.svg" stroke="2px">

To get this type of desired effect: SVG scaling simulation

Is this possible? If not, will this ever be possible for SVG or do they just not work like that?

JLF
  • 2,280
  • 4
  • 28
  • 45

1 Answers1

0

You can use vector-effect="non-scaling-stroke" as demonstrated here

Kerstomaat
  • 673
  • 4
  • 13
  • This only applies to the SVG element, not an image correct? We are talking strictly images that are SVGs here. – JLF May 13 '15 at 17:22
  • Seems to work just fine on Firefox for me: [fiddle](http://jsfiddle.net/kpojmut9/) – Kerstomaat May 13 '15 at 17:28
  • I don't see how you are applying that attribute in this fiddle. – JLF May 13 '15 at 17:31
  • Well, there's no attribute I know off usable on the img-tag itself, but you could just [embed the svg as an object or iframe](http://stackoverflow.com/questions/8102528/how-do-you-access-the-contents-of-an-svg-file-in-an-img-element) and change the attribute in the SVG dom – Kerstomaat May 13 '15 at 17:36