CKTIS / CSS
y — vertical coordinate in SVG
The CSS `y` property sets the vertical position coordinate of selected SVG elements. It accepts a length or a percentage of the current SVG viewport height; it is not a general-purpose positioning property for HTML elements.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
y: <length-percentage>;y is an SVG geometry property. The specification lists it as applying to svg, rect, image, and foreignObject. It does not set the center of a circle or ellipse — use cy for that.
The syntax is y: <length-percentage>;, for example y: 30px; or y: 25%;. Percentages refer to the current SVG viewport height, not the element's height. Negative values are allowed. The initial value is 0, the property is not inherited, and animation is by computed value.
On the relevant elements, the y attribute is a presentation attribute participating in the CSS cascade. The example's #box { y: 25%; } rule overrides y="0" rather than adding an offset to it. Do not equate the CSS y property with every SVG attribute named y.
In the example, the viewport height is 120, so the expected coordinate is 30 SVG user units. The rectangle keeps its size of 60 by 40. This is an expected result for local verification, not a claim of confirmed behavior in a particular browser version.
Examples
<!doctype html>
<meta charset="utf-8">
<title>CSS y</title>
<style>
#box { y: 25%; fill: teal; }
</style>
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="120" viewBox="0 0 200 120">
<rect id="box" x="20" y="0" width="60" height="40" />
</svg>Result
Expected geometry: x=20, y=30, width=60, height=40 (SVG user units).
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.