Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

text-decoration-style — text decoration line pattern

The text-decoration-style property sets the pattern of an underline, overline, or strike-through. It does not enable a decoration itself: text-decoration-line selects the line.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

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

text-decoration-style accepts one value: solid means a continuous line, double two parallel lines, dotted dots, dashed dashes, and wavy a wavy line. The initial value is solid.

The property is not inherited. However, a decoration originating from an ancestor keeps that ancestor’s style across descendant text; setting a different style on a descendant does not change that decoration.

First select a decoration with text-decoration-line, such as underline. The text-decoration shorthand also sets the style: omitting it from a later shorthand resets it to solid. Style animation is discrete, with no smooth interpolation between patterns.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Decoration style</title>
<style>
  .sample {
    text-decoration-line: underline;
    text-decoration-style: wavy;
  }
</style>
<p class="sample">Decoration sample</p>
</html>

Result

Decoration sample — displayed with a wavy underline.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources