Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

ry — SVG vertical radius

The CSS `ry` property sets the vertical radius of an SVG `ellipse` or the vertical corner radius of a `rect`. It accepts a length, percentage, or `auto` and is not inherited.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

ry: <length-percentage> | auto;

ry applies to SVG ellipse and rect elements, not ordinary HTML boxes. Its syntax is ry: <length-percentage> | auto;. The initial value is auto; the property is not inherited and can be animated by computed value.

A percentage refers to the current SVG viewport height, not the shape’s height. If both radii are auto, they resolve to zero. Otherwise, ry: auto takes the resolved length of rx. For rect, this happens before the radii are capped independently: rx at half the rectangle’s width and ry at half its height. So ry: auto does not copy the final used rx after its width cap is applied.

Negative values are invalid; the cited SVG 2 draft requires treating them as auto. The example uses positive lengths: rx: 60px and ry: 20px produce an ellipse wider than it is tall.

Examples

<!doctype html>
<meta charset="utf-8">
<title>CSS ry</title>
<style>
  ellipse { rx: 60px; ry: 20px; fill: teal; }
</style>
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="100" viewBox="0 0 200 100">
  <ellipse cx="100" cy="50" />
</svg>

Result

A teal ellipse centered at (100, 50), with a horizontal radius of 60 and a vertical radius of 20 SVG user units; its bounding box is 120 × 40.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources