CSS text-decoration-style Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Typography

What You’ll Learn

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.

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.

📝 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.

Basic Example

wavy-underline.css
a.help-link {
  text-decoration: underline;
  text-decoration-style: wavy;
}

Syntax Rules

  • 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

🎯 Default Value

The default value of the text-decoration-style property is solid, which applies a solid line to the text decoration.

⚡ Quick Reference

QuestionAnswer
Default valuesolid
Common valuessolid, dotted, dashed, wavy
Wavy underlinetext-decoration: underline wavy;
Pair withtext-decoration-line, text-decoration-color
InheritedNo
AnimatableNo

💎 Property Values

ValueExampleDescription
solidtext-decoration-style: solid;A solid line.
doubletext-decoration-style: double;Two parallel solid lines.
dottedtext-decoration-style: dotted;A dotted line.
dashedtext-decoration-style: dashed;A dashed line.
wavytext-decoration-style: wavy;A wavy line.
solid double dotted dashed wavy

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.

👀 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.

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>

<p class="solid">This is a solid underline.</p>
<p class="wavy">This is a wavy underline.</p>
Try It Yourself

How It Works

Each class sets text-decoration: underline; first, then changes only the line style with text-decoration-style.

Example 2 — Wavy underline for a help link

Use text-decoration-style: wavy; to suggest a spell-check or warning-style underline.

wavy-link.css
.spell-error {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: #dc2626;
}
Try It Yourself

How It Works

Wavy lines draw attention without changing the text itself. Pair with red for error-style feedback.

📄 Practical Use Cases

Use dashed strike-through for drafts and double underlines for emphasis.

Example 3 — Dashed line-through for draft text

Apply a dashed strike-through to show content that is pending or removed.

draft-dashed.css
.draft {
  text-decoration: line-through;
  text-decoration-style: dashed;
  color: #94a3b8;
}
Try It Yourself

How It Works

Dashed line-through looks softer than a solid strike and works well for provisional content.

Example 4 — Double underline for emphasis

Use text-decoration-style: double; to highlight important terms or glossary entries.

double-emphasis.css
.key-term {
  text-decoration: underline;
  text-decoration-style: double;
  text-decoration-color: #7c3aed;
  font-weight: 600;
}
Try It Yourself

How It Works

Double underlines stand out more than a single solid line and pair well with glossary or keyword styling.

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.

full-decoration.css
.help-link {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: #2563eb;
}

🧠 How text-decoration-style Works

1

A decoration line exists

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.

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 Chrome 57+ · Desktop & Mobile
Full support
Mozilla Firefox 36+ · Desktop & Mobile
Full support
Apple Safari 8+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 44+ · 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 property 96% supported

Bottom line: text-decoration-style is safe to use for styled links and text emphasis in modern projects.

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.

💡 Best Practices

✅ Do

  • Set a decoration line before applying text-decoration-style
  • Use wavy sparingly for spell-check or warning-style feedback
  • Use dotted or dashed for subtle link styling
  • Pair with text-decoration-color for branded decoration effects
  • Test wavy and double styles in Safari and Firefox

❌ Don’t

  • Expect style changes without an active decoration line
  • Overuse wavy underlines across large blocks of text
  • Confuse decoration style with border-style
  • Rely on double underlines alone for critical accessibility cues

Key Takeaways

Knowledge Unlocked

Five things to remember about text-decoration-style

Use these points when styling decoration line appearance.

5
Core concepts
02

wavy

Spell-check UI.

Style
03

dashed

Soft strike.

Style
04

Line first

Needs underline.

Rule
🔄 05

text-decoration

Shorthand pair.

Companion

❓ Frequently Asked Questions

text-decoration-style sets the appearance of decoration lines, such as solid, double, dotted, dashed, or wavy underlines and strike-throughs.
The default value is solid, which draws a continuous solid decoration line.
Yes. A decoration line must exist first. Set text-decoration or text-decoration-line such as underline or line-through.
text-decoration is shorthand for line, style, color, and thickness. text-decoration-style controls only how the line looks.
Wavy underlines work well for spell-check hints, playful link styling, or decorative emphasis when used sparingly.

Practice in the Live Editor

Open the HTML editor and try text-decoration: underline wavy; on a paragraph or link.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful