CSS text-decoration-colorProperty
Example
Change the color of the underline in underlined text:
p
{
text-decoration: underline;
text-decoration-color: red;
-moz-text-decoration-color: red; /* Code for Firefox */
}
{
text-decoration: underline;
text-decoration-color: red;
-moz-text-decoration-color: red; /* Code for Firefox */
}
Try it Yourself »
Browser Support
![]()
Almost all mainstream browsers do not support the text-decoration-color property.
Firefox supports an alternative property, namely the -moz-text-decoration-color property.
Definition and Usage
The text-decoration-color property specifies the color of the text decoration (underline, overline, line-through).
Note:The text-decoration-color property only takes effect on elements with a visible text-decoration.
| Default value: | currentColor |
|---|---|
| Inherited: | no |
| Animatable: | Yes. SeeCan be animated (animatable)。 Try it Yourself |
| version: | CSS3 |
| JavaScript Syntax: | object.style.textDecorationColor="red" Try it Yourself |
CSS Syntax
text-decoration-color: color|initial|inherit;
Property value
| Value | Description | Testing |
|---|---|---|
| color | Specifies the color of the text decoration. | Test » |
| initial | Set this property to its default value. Seeinitial。 | Test » |
| inherit | Inherits this property from the parent element. See also...inherit。 |
other extensions