From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/svg/attribute/dx/index.html | 68 +++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 files/zh-cn/web/svg/attribute/dx/index.html (limited to 'files/zh-cn/web/svg/attribute/dx/index.html') diff --git a/files/zh-cn/web/svg/attribute/dx/index.html b/files/zh-cn/web/svg/attribute/dx/index.html new file mode 100644 index 0000000000..66452d48a5 --- /dev/null +++ b/files/zh-cn/web/svg/attribute/dx/index.html @@ -0,0 +1,68 @@ +--- +title: dx +slug: Web/SVG/Attribute/dx +tags: + - SVG + - SVG标签 +translation_of: Web/SVG/Attribute/dx +--- +

« SVG属性参考汇总

+ +

dx属性表示一个元素或其内容在x轴方向上的偏移,偏移量取决于设置该属性的元素。

+ +

对于{{SVGElement("feOffset")}}元素,它的值代表所有输入的图像的偏移量之和。这个总和被表达在由{{SVGElement("filter")}}元素的{{SVGAttr("primitiveUnits")}}属性定义的坐标系中。

+ +

对于{{SVGElement("glyphRef")}}元素,它的值代表该符号在字体坐标系中x轴上的相对坐标。

+ +

对于{{SVGElement("text")}}、{{SVGElement("tspan")}}、{{SVGElement("tref")}}和{{SVGElement("altGlyph")}}元素,由于这些元素允许设置<list-of-length>,所以更复杂。

+ +

如果只提供了一个<length>,当前文本位置会沿着坐标系内x轴方向偏移<length> 。

+ +

如果提供了一个由逗号或者空格分隔的<length>列表,列表中的值将会表示前n个字符沿x轴方向偏移的增量。因此,当前文本位置也因为绘制当前{{SVGElement("text")}}元素而沿x轴方向偏移。

+ +

如果在<length>列表中有更多的字符,那么对于每个字符,都有

+ + + +

用法上下文

+ + + + + + + + + + + + + + + + + + + + +
分类
数值类型<number> | <list-of-length>
可变
规范文档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
+ +

元素

+ +

这些元素可以使用dx属性

+ + -- cgit v1.2.3-54-g00ecf