{"json_modified": "2016-09-09T06:57:52.266218", "uuid": "e21b6ef9-0ec2-4318-8034-5128531bff18", "title": "preserveAspectRatio", "url": "/en-US/docs/Web/SVG/Attribute/preserveAspectRatio", "tags": ["SVG Attribute", "SVG", "NeedsCompatTable", "NeedsExample"], "translations": [], "modified": "2016-09-09T06:57:52", "label": "preserveAspectRatio", "localization_tags": [], "locale": "en-US", "id": 2814, "last_edit": "2016-09-09T06:57:48", "summary": "In some cases, typically when using the viewBox
attribute, it is desirable that the graphics stretch to fit non-uniformly to take up the entire viewport. In other cases, it is desirable that uniform scaling be used for the purposes of preserving the aspect ratio of the graphics.
\n Attribute preserveAspectRatio
indicates whether or not to force uniform scaling.
\n For all elements that support that attribute (see above), except for the <image>
element, preserveAspectRatio
only applies when a value has been provided for viewBox
on the same element. For these elements, if attribute viewBox
is not provided, then preserveAspectRatio
is ignored.
\n For <image>
elements, preserveAspectRatio
indicates how referenced images should be fitted with respect to the reference rectangle and whether the aspect ratio of the referenced image should be preserved with respect to the current user coordinate system.", "sections": [{"id": "Usage_context", "title": "Usage context"}, {"id": "Example", "title": "Example"}, {"id": "Elements", "title": "Elements"}], "slug": "Web/SVG/Attribute/preserveAspectRatio", "review_tags": []}