Style textDecorationColor Property
- Previous Page textDecoration
- Next Page textDecorationLine
- Go Up One Level HTML DOM Style Object
Definition and Usage
textDecorationColor
The attribute specifies the color of the text decoration (underline, overline, strikethrough).
Note:textDecorationColor
The attribute 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";
Syntax
Return textDecorationColor Property:
object.style.textDecorationColor
Set textDecorationColor Property:
object.style.textDecorationColor = "color|initial|inherit"
Property Value
Value | Description |
---|---|
color | Specifies the color of the text decoration. |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Default Value: | currentColor |
---|---|
Return Value: | A string that represents the element's text-decoration-color property. |
CSS Version: | CSS3 |
Browser Support
The numbers in the table 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 |
- Previous Page textDecoration
- Next Page textDecorationLine
- Go Up One Level HTML DOM Style Object