CSS Portal

CSS text-decoration-color 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-color property controls the color used to paint text decorations — for example underlines, overlines and line-throughs — independently of the element’s main text fill. It determines the stroke color applied to those decoration lines so you can make decorations stand out or match other parts of the design without changing the text’s own color. When a specific decoration color isn’t provided, user agents generally fall back to the element’s foreground color as defined by color.

This property interacts with the other text-decoration properties to produce the final decorative effect. Which kinds of decorations are drawn is set by text-decoration-line, and the visual pattern or stroke style of those decorations is controlled by text-decoration-style. The color you assign via text-decoration-color is applied to all decorations on that element; if a descendant element defines its own decoration properties, its own values govern that element’s decorations rather than inheriting from the ancestor.

In terms of rendering and scope, text-decoration-color affects only the painting of text decoration primitives — it does not change borders, outlines, box-shadow, or the underlying text fill. Because decorations are part of text painting, they follow wrapping, fragments and line breaks so the chosen color persists across continuations of the same decorated run. The property is typically resolved during the element’s computed styling (so it will interact predictably with cascade and specificity), and author-defined decoration colors will override defaults while remaining complementary to other typographic styling choices.

Definition

Initial value
currentColor
Applies to
All elements
Inherited
No
Computed value
The computed color
Animatable
Yes
JavaScript syntax
object.style.textDecorationColor

Interactive Demo

The rusty swing set creaked.

Syntax

text-decoration-color: <color>

Values

  • <color>The color data type value can be a named color keyword, or in hexadecimal, RGB, RGBa, HSL or HSLa notation.

Example

<div class="container">
<h1>text-decoration-color examples</h1>
<p class="underline">The quick brown fox jumps over the lazy dog - underlined in tomato.</p>
<p class="overline">The quick brown fox jumps over the lazy dog - overlined in royalblue.</p>
<p class="strikethrough">The quick brown fox jumps over the lazy dog - struck through in seagreen.</p>
<p><a class="link" href="#">A link with a colored underline (rebeccapurple)</a></p>
</div>
.container {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 720px;
    margin: 40px auto;
    line-height: 1.6;
    color: #111;
    padding: 0 20px;
}

.underline {
    text-decoration-line: underline;
    text-decoration-color: tomato;
    text-decoration-thickness: 2px;
    text-decoration-style: solid;
}

.overline {
    text-decoration-line: overline;
    text-decoration-color: royalblue;
    text-decoration-thickness: 2px;
    text-decoration-style: dashed;
}

.strikethrough {
    text-decoration-line: line-through;
    text-decoration-color: seagreen;
    text-decoration-thickness: 2px;
    text-decoration-style: wavy;
}

.link {
    color: inherit;
    text-decoration-line: underline;
    text-decoration-color: rebeccapurple;
    text-decoration-thickness: 2px;
    text-decoration-style: solid;
}

Browser Support

The following information will show you the current browser support for the CSS text-decoration-color 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!