Skip to content

Instantly share code, notes, and snippets.


Charles Koppelman-Milstein ckoppelman

View GitHub Profile
ckoppelman / A.markdown
Last active March 24, 2016 19:55 — forked from larrybotha/A.markdown
Fix SVGs not scaling in IE9, IE10, and IE11
View A.markdown

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.