Definition and Usage
The text-decoration-color
property specifies the color of text decoration lines, as defined by the text-decoration-line
property.
This property allows you to specify the color of the emphasis marks independently from the text color.
If no explicit color is specified, the text decoration color defaults to the element's computed text color.
Basic Example
Specifies the color of the text decoration.
Formal syntax
selector {
text-decoration-color: <color>
}
Values
<color> |
The color of the line decoration. |
---|
Syntax
/* <color> values */
text-decoration-color: currentcolor;
text-decoration-color: red;
text-decoration-color: #00a0e9;
text-decoration-color: rgb(255, 255, 128);
text-decoration-color: rgba(255, 255, 128, 0.5);
text-decoration-color: transparent;
/* Global values */
text-decoration-color: inherit;
text-decoration-color: initial;
text-decoration-color: revert;
text-decoration-color: revert-layer;
text-decoration-color: unset;
Formal definition
Initial value | currentcolor (computed text color) |
---|---|
Applies to | all elements |
Inherited | no |
Percentages | n/a |
Computed value | computed color |
Animation type | by computed value type |
Practical Example
<p>The text decoration color is blue</p>
p {
text-decoration: underline;
text-decoration-thickness: 3px;
text-decoration-color: blue;
}
The text decoration color is blue
Browser compatibility
Property |
Desktop Chrome
|
DesktopDesktop Edge
|
Desktop Firefox
|
Safari
|
---|---|---|---|---|
text-decoration-color
|
57 | 79 | 36 | 12.1 |
Specifications
Specification | |
---|---|
text-decoration-color
|
CSS Text Decoration Module Level 4 #text-decoration-color-property |
See also
- CSS text-decoration-line Property – Specifies Line Decorations
- CSS text-decoration-style Property – Specifies the Style of Text Decorations
- CSS text-decoration-thickness Property – Specifies the Thickness of Text Decoration Lines
- CSS text-decoration Property – Shorthand for Text Decoration Styling
- CSS text-underline-position Property – Specifying the Positional Basis of Underlines
- CSS text-underline-offset Property – Adjusting Underline Offset