text-decoration-inset

An experimental property that allows you to adjust the position of an underline or overline, pushing it closer to or further away from the text baseline.

It is documented as part of the CSS Text Decoration specification. This is an experimental technology. The syntax and behavior are still subject to change.

/* Usage Example */
span {
  text-decoration: underline;
  /* Pushes the underline 2px further down from the text */
  text-decoration-inset: 2px;
}

/* Syntax */
text-decoration-inset: auto;

/* Global values */
text-decoration-inset: inherit;
text-decoration-inset: initial;
text-decoration-inset: revert;
text-decoration-inset: revert-layer;
text-decoration-inset: unset;
Limited availability Since 2020 2% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

146+
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