CSS text-decoration-style Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The text-decoration-style property sets the look of decoration lines created by text-decoration-line—solid, double, dotted, dashed, or wavy.

It is not inherited. The initial value is solid. Style alone is invisible until a line exists. For several decoration settings at once, prefer the text-decoration shorthand.

Non-standard Avoid -moz-none

Firefox once offered -moz-none. Do not use it. Turn decorations off with text-decoration-line: none instead.

CSS Syntax

syntax.css
text-decoration-style: solid | double | dotted | dashed | wavy | initial | inherit;

One keyword only. The same style applies to every line set by text-decoration-line.

Property Values

ValueDescriptionTry it
solidDefault. Single continuous lineTry it
doubleTwo parallel linesTry it
dottedA dotted lineTry it
dashedA dashed lineTry it
wavyA wavy lineTry it
initial / inheritReset to solid, or take the parent valueTry it

How to Use text-decoration-style

Turn a line on first, then choose how that line should look.

  1. Set a decoration line with text-decoration-line: underline (or use the shorthand).
  2. Pick a style: solid, double, dotted, dashed, or wavy.
  3. Optionally set text-decoration-color and text-decoration-thickness.
  4. For deleted text meaning, prefer semantic tags like <del> or <s>, then style them.
PieceRequired?Role
Decoration lineYesunderline, overline, or line-through
Style keywordYesHow that line is drawn
Color / thicknessOptionalRefine look without changing the pattern
ShorthandOptionaltext-decoration: underline wavy red

Live Preview

Change the style on an underlined sample. The underline stays; only the line pattern changes.

Needs text-decoration-line: underline (already set on the sample).

Decoration preview
I'd rather be happy than right

text-decoration-style: wavy

CSS Examples

Each snippet focuses on text-decoration-style. A decoration line is included only so the style is visible. Use Try It Yourself for a live editor.

Example 1 — Solid Underline

The default style: one continuous underline.

CSS
<style>
  .link {
    text-decoration-line: underline;
    text-decoration-style: solid;
  }
</style>

<p class="link">Solid underline</p>
Try It Yourself

How It Works

  1. Turn a line on. text-decoration-line: underline draws the line.
  2. Set the style. solid makes that line continuous.
  3. Default behavior. Leaving style unset looks the same as solid.
  4. Best for links. Most body underlines stay solid for readability.

Example 2 — Wavy Underline

A wavy line is useful for hints or light decorative emphasis.

CSS
<style>
  .hint {
    text-decoration-line: underline;
    text-decoration-style: wavy;
  }
</style>

<p class="hint">Wavy underline</p>
Try It Yourself

How It Works

  1. Keep the underline. Style never creates the line by itself.
  2. Switch to wavy. The browser draws a wave instead of a straight line.
  3. Optional color. Add text-decoration-color when you need a red hint look.
  4. Use sparingly. Wavy lines are attention-grabbing in long text.

Example 3 — Dashed Underline

Dashed (or dotted) lines work well for subtle secondary links.

CSS
<style>
  .soft {
    text-decoration-line: underline;
    text-decoration-style: dashed;
  }
</style>

<p class="soft">Dashed underline</p>
Try It Yourself

How It Works

  1. Underline first. Same as the other examples.
  2. Choose dashed. The line becomes short segments.
  3. Same API for dotted. Swap the keyword to dotted for dots.
  4. Still one style. If you also set overline, both lines share this style.

Edge Cases & Pitfalls

If nothing changes on screen, one of these is usually why.

line

Style needs a decoration line

Without underline, overline, or line-through, changing style has no visible effect.

shared

One style for every line

You cannot give underline and overline different styles on the same element. Both use the same keyword.

semantics

Meaning beats paint alone

For deleted text, use <del> or <s>. Browsers may disable styling; semantic HTML keeps the meaning.

shorthand

Shorthand can reset longhands

Setting text-decoration later can override a previous text-decoration-style. Order your rules carefully.

legacy

Skip -moz-none

That value is non-standard. Hide decorations with text-decoration-line: none.

Browser Support

text-decoration-style is a browser text-decoration property. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

text-decoration-style

Supported in modern browsers since around January 2020 interoperability. Internet Explorer does not support this property.

96% Modern browsers
Google Chrome 57+
Full
Mozilla Firefox 36+
Full
Apple Safari 12.1+
Full
Microsoft Edge 79+
Full
Opera 44+
Full
Samsung Internet 7+
Full
Internet Explorer No
None
text-decoration-style Widely supported

Bottom line: Safe for modern sites. Older Safari needed a -webkit- prefix; IE has no support.

Key Takeaways

  • Role: choose how decoration lines look (not whether they exist).
  • Values: solid, double, dotted, dashed, wavy.
  • Initial value: solid. Not inherited. Needs a decoration line first.
  • Shorthand: text-decoration can set style with line, color, and thickness together.

One line: text-decoration-style picks the pattern of an underline, overline, or line-through.

Frequently Asked Questions

It sets how decoration lines look: solid, double, dotted, dashed, or wavy. The line itself comes from text-decoration-line or the text-decoration shorthand.
The initial value is solid, which draws a single continuous decoration line.
Yes. Style alone does nothing visible until a decoration line exists, such as underline, overline, or line-through.
text-decoration is shorthand for line, style, color, and thickness. text-decoration-style controls only the line pattern.
Wavy lines work well for spell-check style hints or light decorative emphasis. Prefer solid for most links and body text.
It is Baseline Widely available in modern browsers (Chrome 57+, Firefox 36+, Safari 12.1+, Edge 79+). Internet Explorer does not support it. It is a browser rendering property, not a Node.js feature.

Next: text-decoration-thickness

Learn how to control the thickness of decoration lines.

text-decoration-thickness tutorial →

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.

8 people found this page helpful