The text-decoration-color property controls the color of decoration lines on text, so underlines and strike-throughs can match or contrast with your design.
01
Line color
Decoration hue.
02
currentColor
Default match.
03
Named / hex
Color formats.
04
underline
Common use.
05
line-through
Sale prices.
06
Longhand
Part of family.
Fundamentals
Introduction
The text-decoration-color property in CSS is used to set the color of text decorations such as underlines, overlines, and line-throughs. This allows you to customize the appearance of text decorations to match your design preferences, enhancing the visual appeal and readability of your web content.
Definition and Usage
Apply text-decoration-color on elements that already have a decoration line from text-decoration or text-decoration-line.
The decoration color can match the text with currentColor, or you can choose a different color for contrast, such as a red underline under dark text.
💡
Beginner Tip
If you do not see any color change, make sure the element has a decoration line such as text-decoration: underline; first.
Foundation
📝 Syntax
The syntax for the text-decoration-color property is straightforward. It can be applied to any text element, and you can specify a color using any valid CSS color value:
syntax.css
element{text-decoration-color:color;}
Here, color can be a named color, a hexadecimal value, an RGB value, an HSL value, or any other valid CSS color value.
text-decoration-color controls only the strike-through line, not the text fill color.
Companion
text-decoration-color in the family
text-decoration-color is one longhand piece of the text-decoration system. Pair it with text-decoration-line and text-decoration-style, or use the text-decoration shorthand when you want everything in one rule.
The element has underline, overline, or line-through from text-decoration.
Line
2
You set decoration color
text-decoration-color chooses the paint color for that line independently from text color.
CSS rule
3
Browser renders the line
The decoration appears with your chosen color, style, and thickness settings.
Rendering
=
✎
Styled decoration lines
Underlines and strike-throughs match your brand or create useful contrast.
Compatibility
Browser Compatibility
The text-decoration-color property is supported in most modern browsers, including current versions of Chrome, Firefox, Safari, Edge, and Opera. It is always a good practice to test your website across different browsers to ensure compatibility.
✓ Modern browsers · Wide support
Reliable decoration color control
Chrome, Firefox, Safari, Edge, and Opera all support text-decoration-color in current versions.
96%Modern browser support
Google Chrome57+ · Desktop & Mobile
Full support
Mozilla Firefox36+ · Desktop & Mobile
Full support
Apple Safari8+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera44+ · Modern versions
Full support
Testing tip
Verify colored wavy and dotted underlines in Safari and Firefox if your design relies on decorative link styling.
text-decoration-color property96% supported
Bottom line:text-decoration-color is safe to use for styled links and text emphasis in modern projects.
Wrap Up
Conclusion
The text-decoration-color property is a useful tool for web developers looking to enhance the visual appeal of their text content.
By customizing the color of text decorations, you can ensure that your text stands out and aligns with your overall design scheme. Experiment with different colors and see how this property can improve the look and feel of your web projects.