I want to have an inline svg element’s contents scale when size is non-native. Of course I could have it as a separate file and scale it like that.

index.html: <img src="https://stackoverflow.com/questions/19484707/foo.svg" style="width: 100%;" />

foo.svg: <svg width="123" height="456"></svg>

However, I want to add additional styles to the SVG thru CSS, so linking an external one is not an option. How do I make an inline SVG scale?

9 Answers
9

Leave a Reply

Your email address will not be published. Required fields are marked *