--- title: 'xml:space' slug: 'Web/SVG/Attribute/xml:space' translation_of: 'Web/SVG/Attribute/xml:space' ---
« SVG Attribute reference home
SVG supports the standard XML attribute xml:space
to specify the handling of white space characters within a given {{ SVGElement("text") }} element's character data. Note that any child element of a {{ SVGElement("text") }} element may also have an xml:space
attribute which will apply to that child element's text content. Note that this attribute influences the way a browser should parse the xml content and therefore will change the way the DOM is built. It means that any change made to the value of this attribute through the DOM API may have no effect.
Note: Instead of using the xml:space
attribute you should use the {{cssxref("white-space")}} CSS property.
Categories | None |
---|---|
Value | default | preserve |
Animatable | No |
Normative document | SVG 1.1 (2nd Edition) |
xml:space="preserve"
, строка "a b" (три пробела между "a" и "b") будет иметь больше расстояние между "a" и "b", чем "a b" (один пробел между "a" и "b").All the SVG elements can use the xml:space
attribute