Style textDecorationColor Property

Definition and Usage

textDecorationColor The property specifies the color of the text decoration (underline, overline, strikethrough).

Note:textDecorationColor The property is only effective for elements with visible text decoration.

See also:

CSS Reference Manual:text-decoration-color property

Example

Change the color of the line in underlined text:

document.getElementById("demo").style.textDecorationColor = "red";

Try it yourself

Syntax

Return textDecorationColor property:

object.style.textDecorationColor

Set textDecorationColor property:

object.style.textDecorationColor = "color|initial|inherit"

Property value

Value Description
color Specify the color of the text decoration.
initial Set this property to its default value. See initial.
inherit Inherit this property from its parent element. See inherit.
Technical Details
Default value: currentColor
Return value: A string that represents the element's text-decoration-color property.
CSS Version: CSS3

Browser Support

Table numbers indicate the first browser version to fully support this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
57 79.0 36.0 7.1 Webkit 44.0