text-decoration-style
Example
.error {
text-decoration-style: wavy;
text-decoration-color: red;
}.error {
text-decoration: underline wavy red;
}The shorthand sets the line, style and color together, so the wavy underline actually appears.
Common mistakes
- The wavy style doesn't show because no decoration line is set.
Key points
- A decoration line is set too, since
text-decoration-stylealone draws nothing. - Wavy underlines are not used on normal links, where users expect a solid line.
Interview questions
What values does text-decoration-style accept?
solid, double, dotted, dashed and wavy.
How do I make a dashed underline?
Use text-decoration: underline dashed, or set text-decoration-style: dashed along with an underline line.