SVGRectElement: y-Eigenschaft
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
Die y
-Eigenschaft (nur lesbar) des SVGRectElement
-Interfaces beschreibt die vertikale Koordinate der Position eines SVG-Rechtecks als SVGAnimatedLength
. Das <coordinate>
ist eine Länge im Benutzerkoordinatensystem, die die angegebene Entfernung vom Ursprung des Benutzerkoordinatensystems entlang der y-Achse darstellt. Die Syntax entspricht der für <length>
.
Sie spiegelt den geometrischen Attributwert <rect>
-Elements y
wider. Die CSS-Eigenschaft y
hat Vorrang vor dem SVG-y
-Attribut. Daher spiegelt der Wert möglicherweise nicht das Erscheinungsbild des Elements wider. Der Standardwert ist 0
.
Wert
Ein SVGAnimatedLength
.
Beispiel
const rectangle = document.querySelector("rect");
const topPosition = rectangle.y;
console.log(topPosition.baseVal.value); // the `y` value
Spezifikationen
Specification |
---|
Scalable Vector Graphics (SVG) 2 # __svg__SVGRectElement__y |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
y |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support