SVG height not scaling properly on IE 10


IE 10 shows a skewed svg image who’s width is set to a specific value and height is auto.



The problem is the width and height in the SVG file is set and IE is following those specs if you don’t set it.  So if you’re image is 100×100 and you set only the width to 50px, the height will remain at 100px.  The solution is to remove the width and height attributes in the <svg> tag.


A solution on a github gist suggests that removing the width and height attributes force the image to occupy the full width of its container in non-IE browers.  All my current images with SVG are supposed to fill the width so this isn’t a problem for me.
Link to the gist:

Tagged with: ,

Leave a Reply

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