首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

y

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

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

用法

Categories

None

Value

<coordinate>

Animatable

Yes

Normative document

SVG 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

示例

代码语言:javascript
复制
<?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>

扫码关注腾讯云开发者

领取腾讯云代金券