ry

ry

For the <ellipse> element, this attribute defines the y-radius of the element. A value of zero disables rendering of the element.

For the <rect> element, this attribute defines the y-axis radius of the ellipse used to round off the corners of the rectangle. If a properly specified value is provided for ry but not for rx (or the opposite), then the browser will consider the missing value equal to the defined one- If neither ry nor rx has a properly specified value, then the browser will draw a rectangle with square corners. If ry is greater than half of the width of the rectangle, then the browser will consider the value for ry as half of the width of the rectangle.

Usage context

Categories None
Value <length>
Animatable Yes
Normative document SVG 1.1 (2nd Edition): The ellipse element
SVG 1.1 (2nd Edition): The rect element
<length>

A length is a distance measurement, given as a number along with a unit. Lengths are specified in one of two ways. When used in a stylesheet, a <length> is defined as follows:

length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | ~"pt" | ~"pc")?

See the CSS2 specification for the meanings of the unit identifiers.

For properties defined in CSS2, a length unit identifier must be provided. For length values in SVG-specific properties and their corresponding presentation attributes, the length unit identifier is optional. If not provided, the length value represents a distance in the current user coordinate system. In presentation attributes for all properties, whether defined in SVG1.1 or in CSS2, the length identifier, if specified, must be in lower case.

When lengths are used in an SVG attribute, a <length> is instead defined as follows:

length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")?

The unit identifiers in such <length> values must be in lower case.

Note that the non-property <length> definition also allows a percentage unit identifier. The meaning of a percentage length value depends on the attribute for which the percentage length value has been specified. Two common cases are:

  • when a percentage length value represents a percentage of the viewport width or height
  • when a percentage length value represents a percentage of the bounding box width or height on a given object.

In the SVG DOM, <length> values are represented using SVGLength or SVGAnimatedLength objects.

Example

Elements

The following elements can use the ry attribute

© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/ry

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部