非常教程

SVG参考手册

属性 | Attributes

dy

dy属性指示在元素或其内容的位置上沿着y轴的移位。究竟移动什么取决于设置该属性的元素。

对于<feOffset>元素来说,它是一个<number>,它代表了偏移输入图形的数量。这个量在<filter>元素上的primitiveUnits属性所建立的坐标系中表示。

对于<glyphRef>元素来说,它是一个<number>,表示该字形在字体坐标系中的相对Y坐标。

对于<text><tspan><tref>,和<altGlyph>元素,事情稍微复杂一些,因为它们接受<list-of-length>:

如果提供了一个<length>,则该值表示相对于该元素或其任何后代中第一个字符的当前文本位置,产生一个新的相对Y坐标。在呈现第一个字符之前,当前文本位置沿当前用户坐标系的y轴移动一个<length>。

如果提供了一个以逗号或空格分隔的 <length>列表,那么这些值表示相对于该元素或其任何后代中前n个字符的当前文本位置,沿着Y轴的增量移位。因此,通过将所绘字符在当前<text>元素内沿着用户坐标系的Y轴移动一个<length>,我们就得到了一个新的文本位置。

如果存在比<length>更多的字符,那么对于每个额外的字符:

  • 如果祖先<text><tspan>元素通过dy属性指定给定字符的相对Y坐标,则当前文本位置沿当前用户坐标系统的y轴移动该量(最接近的祖先具有优先),
  • 否则不会发生沿y轴的额外移位。

用法上下文

Categories

None

Value

<number> | <list-of-length>

Animatable

Yes

Normative document

SVG 1.1 (2nd Edition): altGlyph element SVG 1.1 (2nd Edition): feOffset element SVG 1.1 (2nd Edition): glyphRef element SVG 1.1 (2nd Edition): text element SVG 1.1 (2nd Edition): tspan element

适用元素

以下元素可以使用dy属性

  • <altGlyph>
  • <feOffset>
  • <glyphRef>
  • <text>
  • <tref>
  • <tspan>

属性 | Attributes相关

1.accent-height(焦点高度)
2.accumulate(积累)
3.additive
4.alignment-baseline(对齐基线)
5.ascent
6.attributename(属性名字)
7.Attributes(属性)
8.attributetype(属性类型)
9.azimuth(方位)
10.basefrequency
11.baseline-shift(基线漂移)
12.baseprofile
13.begin(开始)
14.bias(偏压)
15.calcmode
16.class
17.clip(剪辑)
18.clip-path(剪辑路径)
19.clip-rule(剪辑规则)
20.clippathunits
21.color(颜色)
22.color-interpolation(彩色插值)
23.color-interpolation-filters(色彩插值滤波器)
24.color-profile(彩色轮廓)
25.color-rendering(显色)
26.contentscripttype
27.contentstyletype
28.cursor(光标)
29.cx
30.cy
31.d
32.diffuseconstant
33.direction(方向)
34.display(显示)
35.divisor
36.dominant-baseline(显性基线)
37.dur
38.dx
39.edgemode
40.elevation
41.end
42.externalresourcesrequired
43.fill
44.fill-opacity
45.fill-rule
46.filter
47.filterres
48.filterunits
49.flood-color
50.flood-opacity
51.font-family
52.font-size
53.font-size-adjust
54.font-stretch
55.font-style
56.font-variant
57.font-weight
58.fr
59.from
60.fx
61.fy
62.gradienttransform
63.gradientunits
64.height
65.href
66.image-rendering
67.in
68.in2
69.k1
70.k2
71.k3
72.k4
73.kernelmatrix
74.kernelunitlength
75.kerning
76.keysplines
77.keytimes
78.lengthadjust
79.letter-spacing
80.lighting-color
81.limitingconeangle
82.local
83.marker-end
84.marker-mid
85.marker-start
86.markerheight
87.markerunits
88.markerwidth
89.mask
90.maskcontentunits
91.maskunits
92.max
93.min
94.mode
95.numoctaves
96.opacity
97.operator
98.order
99.overflow
100.overline-position
SVG

可缩放矢量图形是基于可扩展标记语言(标准通用标记语言的子集),用于描述二维矢量图形的一种图形格式。它由万维网联盟制定,是一个开放标准。