0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>By default, SVG content with a viewBox is scaled to maintain the aspect ratio, and if the aspect ratios of the sides of the viewport and viewbox do not match, margins will appear around the content:</p>
1
<p>By default, SVG content with a viewBox is scaled to maintain the aspect ratio, and if the aspect ratios of the sides of the viewport and viewbox do not match, margins will appear around the content:</p>
2
<p>The preserveAspectRatio property can be used to change this behavior: for example, the value none indicates that the aspect ratio should not be preserved:</p>
2
<p>The preserveAspectRatio property can be used to change this behavior: for example, the value none indicates that the aspect ratio should not be preserved:</p>
3
<svg viewBox="0 0 237 300" preserveAspectRatio="none"> … </svg><p>In this case, the area whose dimensions are set by the viewbox is stretched to fit the entire available viewport space:</p>
3
<svg viewBox="0 0 237 300" preserveAspectRatio="none"> … </svg><p>In this case, the area whose dimensions are set by the viewbox is stretched to fit the entire available viewport space:</p>
4
<p>preserveAspectRatio is set only using an attribute.</p>
4
<p>preserveAspectRatio is set only using an attribute.</p>