CSS text-decoration Property
Description
The text-decoration property is the CSS shorthand used to control decorative markings applied to text — lines and related strokes that augment glyphs to convey emphasis, semantics or visual style. These decorations are visual painting instructions layered with the text (rather than changes to box geometry), so they typically do not alter layout or the flow of surrounding content. Authors use this property to express things like emphasis, links or typographic ornamentation while keeping the underlying document structure and line boxes unchanged.
Under the hood the shorthand controls several more specific longhand properties that determine what gets painted and how: text-decoration-line, text-decoration-color, text-decoration-style, and text-decoration-thickness. There are also related controls such as text-decoration-skip-ink that influence whether decorations avoid intersecting glyph ink. Because it is a shorthand, using it will set those component properties together; many authors prefer the longhand properties when they need fine-grained typographic control.
Rendering of text decorations takes into account line fragmentation, inheritance and compositing rules. Decorations can span inline boxes and are carried across element boundaries in many cases so that a continuous underline or strike-through can appear even when the marked-up text is split across elements or lines. Decorations are drawn relative to the glyph metrics and can interact with the element’s text color and shadows — for example, decoration color often relates to the element’s color unless explicitly specified — and their visual placement can be adjusted in conjunction with typographic controls like text-underline-position. Because decorations are visual only, they generally don’t affect hit-testing or layout, but they are important for accessibility and visual affordances, so consider their appearance across interactive states and when combining with effects such as text-shadow.
Definition
- Initial value
- none
- Applies to
- All elements
- Inherited
- No
- Computed value
- See individual properties
- Animatable
- See individual properties
- JavaScript syntax
- object.style.textDecoration
Interactive Demo
Syntax
text-decoration: <text-decoration-line> || <text-decoration-style> || <text-decoration-color>
Values
- <text-decoration-line>See the text-decoration-line CSS property for values.
- <text-decoration-style>See the text-decoration-style CSS property for values.
- <text-decoration-color>See the text-decoration-color CSS property for values.
Example
Browser Support
The following information will show you the current browser support for the CSS text-decoration property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
