text-decoration

A shorthand property that sets the appearance of decorative lines on text, such as underlines, overlines, and strike-throughs.

It is documented as part of the CSS Text Decoration specification.

/* Usage Example */
a.modern-link {
  text-decoration: underline var(--accent) 2px;
  text-underline-offset: 4px;
  /* creates a custom colored underline with custom thickness and offset */
}

/* Syntax */
text-decoration: text-decoration-line;
text-decoration: text-decoration-style;
text-decoration: text-decoration-color;
text-decoration: text-decoration-thickness;

/* Global values */
text-decoration: inherit;
text-decoration: initial;
text-decoration: revert;
text-decoration: revert-layer;
text-decoration: unset;
Widely available Since 2015 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.

1+
1+
1+
12+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC