SVGs not Scaling Properly in IE - has extra space
Problem: When using SVG symbols for responsiveness, the SVGs do not scale properly in Internet Explorer (IE).
Answer: IE has a bug that prevents SVGs from scaling correctly unless both the width and height are specified.
Solution:
Use a trick discovered by Nicolas Gallagher:
Code:
<div>
CSS:
canvas { display: block; width: 100%; visibility: hidden; } svg { position: absolute; top: 0; left: 0; width: 100%; }
Note: This trick forces IE to scale the SVG correctly by using the
The above is the detailed content of Why Aren't My SVGs Scaling Correctly in Internet Explorer?. For more information, please follow other related articles on the PHP Chinese website!