coderef

text-underline-positionBaseline · Widely available

The text-underline-position CSS property sets the position of underlines on text. For example, text-underline-position: under places the underline below the text, avoiding crossing descenders. The underline may be further adjusted by the text-underline-offset property.

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

Browser support

DesktopChrome
1–32Not supported
33+Supportedsince Feb 20, 2014
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1–73Not supported
74+Supportedsince Mar 10, 2020
Current: 157
Safari
1–12Not supported
12.1+Supportedsince Mar 25, 2019
Current: 27
MobileChrome Android
18–32Not supported
33+Supportedsince Feb 26, 2014
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-position.

Feature detection

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

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

Sub-features

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

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
text-underline-position33127412.1337912.2
text-underline-position.auto33797412.1337912.2
text-underline-position.from-font87877412.1877912.2
text-underline-position.left71797418.2717918.2
text-underline-position.right71797418.2717918.2
text-underline-position.under33797412.1337912.2