Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

text-decoration-line — choosing text decoration lines

The text-decoration-line property selects underlines, overlines, or strike-throughs. Lines can be combined; none on a descendant does not remove a decoration originating from an ancestor.

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

Syntax

text-decoration-line: none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error;

text-decoration-line selects text decorations: underline draws an underline, overline draws an overline, and line-through draws a strike-through. The || notation allows values to be combined in any order without duplicates. none stands alone and is the initial value.

The property is not inherited, but decorations can propagate to descendants’ text. Consequently, none on a descendant does not remove an ancestor’s line. This property is a longhand of text-decoration; separate properties control the color, style, and thickness of ordinary lines.

Deprecated blink does not guarantee blinking. The Level 4 draft adds standalone spelling-error and grammar-error values: the browser determines these markers’ appearance, ignoring the other text-decoration longhands. Do not infer support for these values from the specification alone.

The example sets an underline and a strike-through on the paragraph and none on its descendant span. Chromium 157 confirmed that the body text was Alpha Beta. The check covered only the text, not whether both lines were drawn across the descendant’s text.

Examples

<!doctype html>
<meta charset="utf-8">
<title>text-decoration-line</title>
<style>
  .sample {
    font: 24px sans-serif;
    text-decoration-line: underline line-through;
    text-decoration-color: #000;
    text-decoration-style: solid;
    text-decoration-thickness: 2px;
  }
  .sample span { text-decoration-line: none; }
</style>
<p class="sample">Alpha <span>Beta</span></p>

Result

Alpha Beta

An isolated Chromium 157 check confirmed `Alpha Beta` as the `body` text. It did not check how the decoration lines were rendered.

Sources