coderef

abs() and sign()Baseline · Newly available

The abs() and sign() CSS functions compute the absolute value or the sign of the input.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Jun 26, 2025.

Browser support

DesktopChrome
1–137Not supported
138+Supportedsince Jun 24, 2025
Current: 155
Edge
12–137Not supported
138+Supportedsince Jun 26, 2025
Current: 154
Firefox
1–117Not supported
118+Supportedsince Sep 26, 2023
Current: 157
Safari
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27
MobileChrome Android
18–137Not supported
138+Supportedsince Jun 24, 2025
Current: 155
Firefox Android
4–117Not supported
118+Supportedsince Sep 26, 2023
Current: 157
Safari iOS
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Jun 26, 2025. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN: abs.

Feature detection

CSS · check before using
@supports (width: abs(-1px)) {
  /* styles that use abs */
}

/* or in JavaScript */
if (CSS.supports("width", "abs(-1px)")) {
  // use it
}

Documentation (MDN)

Specification

Sub-features

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

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
<abs>13813811815.413811815.4
<sign>13813811815.413811815.4