大网数据广告活动
Web 标准与前端开发

SVGPreserveAspectRatio

· 52CE 我爱测

The **`SVGPreserveAspectRatio`** interface corresponds to the preserveAspectRatio attribute.

SVG

The SVGPreserveAspectRatio interface corresponds to the preserveAspectRatio attribute.

An SVGPreserveAspectRatio object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.

Static properties

  • SVG_PRESERVEASPECTRATIO_UNKNOWN (0)
    • : The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
  • SVG_PRESERVEASPECTRATIO_NONE (1)
    • : Corresponds to value none for attribute preserveAspectRatio.
  • SVG_PRESERVEASPECTRATIO_XMINYMIN (2)
    • : Corresponds to value xMinYMin for attribute preserveAspectRatio.
  • SVG_PRESERVEASPECTRATIO_XMIDYMIN (3)
    • : Corresponds to value xMidYMin for attribute preserveAspectRatio.
  • SVG_PRESERVEASPECTRATIO_XMAXYMIN (4)
    • : Corresponds to value xMaxYMin for attribute preserveAspectRatio.
  • SVG_PRESERVEASPECTRATIO_XMINYMID (5)
    • : Corresponds to value xMinYMid for attribute preserveAspectRatio.
  • SVG_PRESERVEASPECTRATIO_XMIDYMID (6)
    • : Corresponds to value xMidYMid for attribute preserveAspectRatio.
  • SVG_PRESERVEASPECTRATIO_XMAXYMID (7)
    • : Corresponds to value xMaxYMid for attribute preserveAspectRatio.
  • SVG_PRESERVEASPECTRATIO_XMINYMAX (8)
    • : Corresponds to value xMinYMax for attribute preserveAspectRatio.
  • SVG_PRESERVEASPECTRATIO_XMIDYMAX (9)
    • : Corresponds to value xMidYMax for attribute preserveAspectRatio.
  • SVG_PRESERVEASPECTRATIO_XMAXYMAX (10)
    • : Corresponds to value xMaxYMax for attribute preserveAspectRatio.
  • SVG_MEETORSLICE_UNKNOWN (0)
    • : The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
  • SVG_MEETORSLICE_MEET (1)
    • : Corresponds to value meet for attribute preserveAspectRatio.
  • SVG_MEETORSLICE_SLICE (2)
    • : Corresponds to value slice for attribute preserveAspectRatio.

Instance properties

  • SVGPreserveAspectRatio.align
    • : The type of the alignment value as specified by one of the SVG_PRESERVEASPECTRATIO_* constants defined on this interface.
  • SVGPreserveAspectRatio.meetOrSlice
    • : The type of the meet-or-slice value as specified by one of the SVG_MEETORSLICE_* constants defined on this interface.

Instance methods

The SVGPreserveAspectRatio interface do not provide any specific methods.

Specifications

Browser compatibility

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。