Interactive online courses HTML Academy
2026-03-09 14:11 Diff

The second parameter in the preserveAspectRatio property is responsible for determining the behavior of the content relative to the viewport. It determines how exactly the content fills the space:

<svg viewBox="0 0 237 300" preserveAspectRatio="xMinYMin meet"> … </svg>

Possible values:

meet - The content fills the space in its entirety, leaving empty margins (as with background-size: contain). This is the default value.

slice - The content fills the entire space, though some of the content may be cut off (similar to background-size: cover). The aspect ratio is the same in both cases.

Padding is an optional parameter. It can be omitted.