Back to Content

white-space

files/en-us/web/svg/reference/attribute/white-space/index.md

latest1.2 KB
Original Source

The white-space SVG attribute specifies how {{Glossary("whitespace", "white space")}} within text should be handled. This includes whether and how white space inside the element is collapsed and whether lines may wrap at unforced soft wrap opportunities.

[!NOTE] As a presentation attribute, white-space also has a CSS property counterpart: {{cssxref("white-space")}}. When both are specified, the CSS property takes priority.

Usage notes

<table class="properties"> <tbody> <tr> <th scope="row">Value</th> <td><code>normal</code> | <code>pre</code> | <code>nowrap</code> | <code>pre-wrap</code> | <code>break-space</code> | <code>pre-line</code></td> </tr> <tr> <th scope="row">Default value</th> <td><code>normal</code></td> </tr> <tr> <th scope="row">Animatable</th> <td>No</td> </tr> </tbody> </table>

For a description of the values, please refer to the CSS white-space property.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{SVGAttr("xml:space")}} attribute
  • CSS {{cssxref("white-space")}} property