在线文档教程
SVG
属性 | Attributes

y

y

y属性表示当前SVG坐标系中的y轴坐标。这个坐标的确切作用取决于元素。大多数情况下,它代表参考元素边界框左上角的y轴坐标,垂直定位元素。

如果没有指定属性,默认值是0,除了<filter>与<mask>其中默认为元素-10% 。

用法

CategoriesNone
Value<coordinate>
AnimatableYes
Normative documentSVG 1.1 (2nd Edition): altGlyph element SVG 1.1 (2nd Edition): cursor element SVG 1.1 (2nd Edition): fePointLight element SVG 1.1 (2nd Edition): feSpotLight element SVG 1.1 (2nd Edition): filter element SVG 1.1 (2nd Edition): foreignObject element SVG 1.1 (2nd Edition): glyphRef element SVG 1.1 (2nd Edition): image element SVG 1.1 (2nd Edition): pattern element SVG 1.1 (2nd Edition): rect element SVG 1.1 (2nd Edition): svg element SVG 1.1 (2nd Edition): text element SVG 1.1 (2nd Edition): use element SVG 1.1 (2nd Edition): Filter primitive SVG 1.1 (2nd Edition): mask element SVG 1.1 (2nd Edition): tspan element

示例

<?xml version="1.0"?> <svg width="120" height="120" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"/> </svg>

元素

以下元素可以使用该y属性

  • 过滤原始元素»

  • <altGlyph>

  • <fePointLight>

  • <feSpotLight>

  • <filter>

  • <foreignObject>

  • <glyphRef>

  • <image>

  • <pattern>

  • <rect>

  • <svg>

  • <text>

  • <use>

  • <mask>

  • <tref>

  • <tspan>