CSS provides several properties to decorate text.
Specifies the decoration added to text.
none: No decoration (default). underline: Adds a line beneath the text. overline: Adds a line above the text. line-through: Adds a line through the middle of the text. underline overline: Adds both underline and overline. span { text-decoration: "underline overline"; // other options: line-through, overline, underline, none; }
none: No decoration. underline: Adds an underline. overline: Adds an overline. line-through: Adds a line through the text. span { text-decoration-line: line-through; // other options: overline, none, underline; }
Specifies the type of text decoration to apply.
solid: A solid line. double: Two solid lines. dotted: A series of dots. dashed: A series of dashes. wavy: A wavy line. span { text-decoration-style: solid; // other options: wavy, dashed, dotted, double; }
span { text-decoration-color: blue; } // other options to pass value #hexadecimal text-decoration-color: #000; #rgb text-decoration-color: rgb(0, 0, 0); #rgba text-decoration-color: rgb(0, 0, 0, 0.2); // 0.2 is opacity
Specifies the style of the text decoration line.
Specifies the color of the text decoration line. Any valid color value (hexadecimal, RGBA, RGB, color name).