The text-decoration-line property sets which decoration lines appear on text—underline, overline, line-through, or none. It is the line longhand of the text-decoration shorthand.
Combine line keywords with spaces (for example underline overline). blink, spelling-error, and grammar-error exist but are special cases—see the callouts above.
List the lines.underline and overline are both allowed together.
Order is flexible.overline underline draws the same pair.
Shared style/color. One style and one color apply to all lines on the element.
Add strike. You can also include line-through in the same list.
Edge Cases & Pitfalls
If a decoration looks wrong, one of these is usually why.
child
Children cannot erase a parent line
A parent underline still paints through a child. text-decoration-line: none on the child does not remove it; the child can only add another line.
shorthand
Prefer the longhand to preserve color
Setting text-decoration: underline on hover can wipe a custom color or thickness. Toggle with text-decoration-line instead.
blink
Avoid blink
The blink value is deprecated and should not be used in production CSS.
errors
spelling-error / grammar-error are special
They use native browser error styling and ignore many other decoration longhands. Support is still catching up—do not rely on them for critical UI yet.
inherit
Not inherited by default
The property’s inherited flag is no. Use the inherit keyword when a child must take the parent’s line value.
Compatibility
Browser Support
text-decoration-line is a browser CSS property for decoration lines. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available since Jan 2020
text-decoration-line
Common keywords: Chrome 57+, Firefox 36+, Safari 12.1+, Edge 79+. spelling-error / grammar-error: Chrome/Edge 121+, Firefox 137+, Safari 26.2+. Not supported as a longhand in Internet Explorer.
97%Common keywords support
Google Chrome57+
Full support
Mozilla Firefox36+
Full support
Apple Safari12.1+
Full support
Microsoft Edge79+
Full support
Opera44+
Full support
Samsung Internet7+
Full support
Internet ExplorerNo longhand
Not supported
text-decoration-lineWidely supported
Bottom line: Safe for none, underline, overline, and line-through in modern browsers. Treat spelling/grammar values as progressive enhancement.
Remember
Key Takeaways
Role: chooses which decoration lines are drawn on text.
Common values:none, underline, overline, line-through.
Initial value:none. Not inherited.
Pitfall: a child none does not cancel a parent decoration.
One line: use text-decoration-line to draw or clear lines without resetting style, color, or thickness.
Frequently Asked Questions
It chooses which decoration lines appear on text: none, underline, overline, line-through, or a combination of those keywords.
none. No decoration line is drawn until you set one.
text-decoration is the shorthand for line, style, color, and thickness. text-decoration-line controls only which lines are drawn, so it does not reset style or color.
Yes. Space-separate keywords, for example text-decoration-line: underline overline.
No. blink is deprecated, often ignored, and inaccessible. Prefer CSS animations if you need motion.
Baseline widely available for none, underline, overline, and line-through (Chrome 57+, Firefox 36+, Safari 12.1+, Edge 79+). spelling-error and grammar-error are newer. It is a browser CSS property, not a Node.js feature.