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.