非常教程

SVG参考手册

属性 | Attributes

xml:space(xml:空间)

自SVG 2起弃用

该功能已从Web标准中删除。尽管一些浏览器可能仍然支持,但它正在被丢弃。不要在旧的或新的项目中使用它。使用它的页面或Web应用程序可能会随时中断。

«SVG属性参考主页

SVG支持标准的XML属性xml:space来指定处理给定<text>元素的字符数据中的空白字符。请注意,元素的任何子<text>元素也可能具有xml:space将应用于该子元素的文本内容的属性。请注意,此属性影响浏览器分析xml内容的方式,因此将改变DOM的构建方式。这意味着,通过DOM API对此属性的值进行的任何更改都可能不起作用。

注意:不要使用xml:space属性,而应该使用white-spaceCSS属性。

使用上下文

Categories

None

Value

default | preserve

Animatable

No

Normative document

SVG 1.1 (2nd Edition)

默认浏览器将删除所有换行符。然后它会将所有制表符转换成空格字符。然后,它将去除所有前导和尾随空格字符。然后,将所有连续的空格字符合并.preserve浏览器将把所有换行符和制表符转换为空格字符。然后,它将绘制所有的空间字符,包括前导,尾随和多个连续的空间字符。因此,在绘制时xml:space="preserve",字符串“ab”(“a”和“b”之间的三个空格)将产生比“ab”(a和b之间的一个空格)更大的“a”和“b” “)。

示例

元素

所有的SVG元素都可以使用该xml:space属性

属性 | 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.dy
40.edgemode
41.elevation
42.end
43.externalresourcesrequired
44.fill
45.fill-opacity
46.fill-rule
47.filter
48.filterres
49.filterunits
50.flood-color
51.flood-opacity
52.font-family
53.font-size
54.font-size-adjust
55.font-stretch
56.font-style
57.font-variant
58.font-weight
59.fr
60.from
61.fx
62.fy
63.gradienttransform
64.gradientunits
65.height
66.href
67.image-rendering
68.in
69.in2
70.k1
71.k2
72.k3
73.k4
74.kernelmatrix
75.kernelunitlength
76.kerning
77.keysplines
78.keytimes
79.lengthadjust
80.letter-spacing
81.lighting-color
82.limitingconeangle
83.local
84.marker-end
85.marker-mid
86.marker-start
87.markerheight
88.markerunits
89.markerwidth
90.mask
91.maskcontentunits
92.maskunits
93.max
94.min
95.mode
96.numoctaves
97.opacity
98.operator
99.order
100.overflow
SVG

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