coderef

text-underline-offsetBaseline · Widely available

The text-underline-offset CSS property shifts underlines on text from the initial position by a given distance. The initial position is affected by the text-underline-position property.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Nov 19, 2020. Widely available since May 19, 2023.

Browser support

DesktopChrome
1–86Not supported
87+Supportedsince Nov 17, 2020
Current: 155
Edge
12–86Not supported
87+Supportedsince Nov 19, 2020
Current: 154
Firefox
1–69Not supported
70+Supportedsince Oct 22, 2019
Current: 157
Safari
1–12Not supported
12.1+Supportedsince Mar 25, 2019
Current: 27
MobileChrome Android
18–86Not supported
87+Supportedsince Nov 17, 2020
Current: 155
Firefox Android
4–68Not supported
79+Supportedsince Jul 28, 2020
Current: 157
Safari iOS
1–12Not supported
12.2+Supportedsince Mar 25, 2019
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: text-underline-offset.

Feature detection

CSS · check before using
@supports (text-underline-offset: initial) {
  /* styles that rely on text-underline-offset */
}

/* or in JavaScript */
if (CSS.supports("text-underline-offset", "initial")) {
  // use it
}

Sub-features

Support for each part of the feature (3). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
text-underline-offset87877012.1877912.2
text-underline-offset.auto87877012.1877912.2
text-underline-offset.percentage87877418.2877918.2