CSS Portal

CSS text-decoration-style Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The text-decoration-style property controls the visual pattern used to draw decoration lines applied to text—such as underlines, overlines, or line-through marks—by defining the line’s appearance (its overall texture and how it is painted). It does not decide whether a decoration exists; that is determined by text-decoration-line. Instead, this property only affects how any existing decoration is rendered, so changing it can make the same underline look bold, subtle, broken, or ornamental without altering layout or semantics.

Because text decoration is typically composed of several cooperating properties, text-decoration-style is used together with the shorthand text-decoration and with other decoration-related properties such as text-decoration-color to produce the final visual result. In practice you set the style when you want text decorations to match a design language (for example, to appear delicate or prominent) while using color and thickness controls to tune contrast and legibility. The shorthand can set multiple decoration aspects at once, but adjusting text-decoration-style independently gives more granular control.

Rendering considerations are important: the chosen style interacts with line fragmentation, wrapping, and how decorations are painted across inline boxes. The exact visual outcome can vary depending on font metrics, rendering engine decisions about placement and clipping, and whether decorations are applied to parent elements or directly to the inline element. For accessibility and readability, prefer styles that maintain sufficient contrast and clear separation from glyph shapes; when fine control is needed over position and weight of the decoration, combine the style choice with complementary properties (such as thickness or offset controls) to achieve a stable, legible result.

Definition

Initial value
solid
Applies to
All elements
Inherited
No
Computed value
As specified
Animatable
No
JavaScript syntax
object.style.textDecorationStyle

Interactive Demo

The rusty swing set creaked.

Syntax

text-decoration-style: solid | double | dotted | dashed | wavy

Values

  • solidA single line segment.
  • doubleTwo solid lines that are parallel with some space between them.
  • dottedA series of round dots.
  • dashedA series of square-ended dashes.
  • wavyIndicates a wavy line.

Example

<body>
<main class='container'>
<h1>text-decoration-style examples</h1>
<p class='decoration-solid'>Solid underline</p>
<p class='decoration-double'>Double underline</p>
<p class='decoration-dotted'>Dotted underline</p>
<p class='decoration-dashed'>Dashed underline</p>
<p class='decoration-wavy'>Wavy underline</p>
<a href='#' class='link-wavy'>Wavy link (anchor)</a>
</main>
</body>
/* Example showing different text-decoration-style values */
.container {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  padding: 24px;
  max-width: 720px;
  margin: 0 auto;
  color: #111;
}

h1 {
  font-size: 20px;
  margin-bottom: 16px;
}

p, a {
  font-size: 18px;
  margin: 12px 0;
}

.decoration-solid {
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-color: #1a73e8;
  text-decoration-thickness: 3px;
}

.decoration-double {
  text-decoration-line: underline;
  text-decoration-style: double;
  text-decoration-color: #e91e63;
  text-decoration-thickness: 4px;
}

.decoration-dotted {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: #ff9800;
  text-decoration-thickness: 3px;
}

.decoration-dashed {
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-color: #6a1b9a;
  text-decoration-thickness: 3px;
}

.decoration-wavy {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: #2e7d32;
  text-decoration-thickness: 3px;
}

.link-wavy {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: #00796b;
  text-decoration-thickness: 2px;
  color: #00796b;
}

a.link-wavy:hover {
  text-decoration-color: #004d40;
}

Browser Support

The following information will show you the current browser support for the CSS text-decoration-style property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!