score:1

Accepted answer

SVG attribute preserveAspectRatio indicates whether or not to force uniform scaling.

xMinYMin - Force uniform scaling. Align the of the element's viewBox with the smallest X value of the viewport. Align the of the element's viewBox with the smallest Y value of the viewport.

<svg preserveAspectRatio="xMinYMin" viewBox="0 0 300 100"></svg>

Note viewBox as opposed to width and height attributes.


Related Query

More Query from same tag