SVG text-decoration Attribute
The text-decoration attribute defines whether text is written with a strike-through, overline and/or underline. The main difference between CSS text-decoration property and SVG text-decoration attribute is that, SVG uses the ‘fill‘ and ‘stroke‘ values to paint the text decorations. It has effect only on the following elements <altGlyph>, <text>, <textPath>, <tref>, and <tspan>.
text-decoration = "text-decoration-line" | "text-decoration-style" | "text-decoration-color"
Attribute Values: The text-decoration attribute accepts the values mentioned above and described below
- text-decoration-line: It sets the text-decoration, to line-through or underline.
- text-decoration-style: It sets the style of the line used for the decoration, such as solid, wavy, or dashed.
- text-decoration-color: It sets the color of the decoration.
Example 1: Below examples illustrate the use of text-decoration attribute.