The text-decoration-style property defines how decoration lines look — solid, double, dotted, dashed, or wavy.
01
solid
Default line.
02
double
Two lines.
03
dotted
Dot pattern.
04
dashed
Dash pattern.
05
wavy
Curved line.
06
Longhand
Style only.
Fundamentals
Introduction
The text-decoration-style property in CSS allows developers to define the style of text decorations applied to text content.
This property can be used to customize the appearance of text underlines, overlines, and line-throughs, giving you control over the visual style of these text decorations. It enhances the ability to create visually distinct and appealing text presentations.
Definition and Usage
Use text-decoration-style when a decoration line already exists and you want to change how that line is drawn. Pair it with text-decoration-line and text-decoration-color for full control.
It is the longhand alternative to setting line style inside the text-decoration shorthand, such as text-decoration: underline wavy red;.
💡
Beginner Tip
Always set a decoration line first with text-decoration: underline; or text-decoration-line: underline;, then apply text-decoration-style.
Foundation
📝 Syntax
The syntax for the text-decoration-style property is simple. It can be applied to any text element to define the style of the text decoration:
syntax.css
element{text-decoration-style:style;}
Here, style can be one of the predefined values that determine the appearance of the text decoration.
Set a decoration line before applying text-decoration-style.
Style keywords include solid, double, dotted, dashed, and wavy.
The default style is solid when a decoration line is present.
Pair with color and thickness longhands for polished decoration effects.
Related Properties
text-decoration — shorthand for line, style, color, and thickness
text-decoration-line — sets which lines appear
text-decoration-color — sets decoration line color
text-decoration-thickness — sets line thickness
Defaults
🎯 Default Value
The default value of the text-decoration-style property is solid, which applies a solid line to the text decoration.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Default value
solid
Common values
solid, dotted, dashed, wavy
Wavy underline
text-decoration: underline wavy;
Pair with
text-decoration-line, text-decoration-color
Inherited
No
Animatable
No
Reference
💎 Property Values
Value
Example
Description
solid
text-decoration-style: solid;
A solid line.
double
text-decoration-style: double;
Two parallel solid lines.
dotted
text-decoration-style: dotted;
A dotted line.
dashed
text-decoration-style: dashed;
A dashed line.
wavy
text-decoration-style: wavy;
A wavy line.
soliddoubledotteddashedwavy
Context
When to Use text-decoration-style
text-decoration-style is the right choice when you want to change how a decoration line looks:
Links — Use dotted or dashed underlines for subtle link styling.
Spell-check UI — Wavy underlines suggest errors or warnings.
Emphasis — Double underlines can highlight important terms.
Design systems — Split line style from color and thickness in separate rules.
Preview
👀 Live Preview
All five text-decoration-style values on underlined sample text:
This is a solid underline.
This is a double underline.
This is a dotted underline.
This is a dashed underline.
This is a wavy underline.
Hands-On
Examples Gallery
In this example, we’ll apply different text-decoration styles to various text elements — matching the reference, then exploring practical patterns.
📜 Decoration Line Styles
Compare solid, double, dotted, dashed, and wavy underline styles side by side.
Example 1 — All decoration styles
In this example, we’ll apply different text-decoration-style values to underlined text elements.
index.html
<style>.solid{text-decoration:underline;text-decoration-style:solid;}.wavy{text-decoration:underline;text-decoration-style:wavy;}</style><pclass="solid">This is a solid underline.</p><pclass="wavy">This is a wavy underline.</p>
Double underlines stand out more than a single solid line and pair well with glossary or keyword styling.
Companion
text-decoration-style in the family
text-decoration-style controls how the line is drawn. Combine it with text-decoration-line and text-decoration-color, or use the text-decoration shorthand when you want all parts in one declaration.
The element has underline, overline, or line-through from text-decoration.
Line
2
You choose the line style
Set solid, double, dotted, dashed, or wavy with text-decoration-style.
Style
3
Browser draws the pattern
The decoration line follows your style choice along the text glyphs.
Rendering
=
✎
Distinct decoration effects
Links, warnings, and emphasis get the right visual line treatment.
Compatibility
Browser Compatibility
The text-decoration-style property is supported in most modern browsers, including current versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.
✓ Modern browsers · Wide support
Reliable decoration style control
Chrome, Firefox, Safari, Edge, and Opera all support text-decoration-style in current versions.
96%Modern browser support
Google Chrome57+ · Desktop & Mobile
Full support
Mozilla Firefox36+ · Desktop & Mobile
Full support
Apple Safari8+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera44+ · Modern versions
Full support
Testing tip
Verify wavy and dotted underlines in Safari and Firefox if your design relies on decorative link styling.
text-decoration-style property96% supported
Bottom line:text-decoration-style is safe to use for styled links and text emphasis in modern projects.
Wrap Up
Conclusion
The text-decoration-style property is a versatile tool for web developers aiming to create distinctive text decorations.
By using different styles like solid, double, dotted, dashed, and wavy, you can enhance the visual appeal and readability of your text. Experiment with these styles to see how they can improve the aesthetics and user experience of your web projects.