[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/CSS/Reference/Values/abs [Back]  [Original]

abs() - CSS: Cascading Style Sheets | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

abs()

Baseline 2025
Newly available

Since 2025 6, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

abs() CSS , .

In this article

css
/* property: abs(expression) */
width: abs(20% - 100px);

abs(x) .

x

.

x .

  • x 0 x .
  • -1 * x .

<abs()> = 
abs( <calc-sum> )

<calc-sum> =
<calc-product> [ [ '+' | '-' ] <calc-product> ]*

<calc-product> =
<calc-value> [ [ '*' | / ] <calc-value> ]*

<calc-value> =
<number> |
<dimension> |
<percentage> |
<calc-keyword> |
( <calc-sum> )

<calc-keyword> =
e |
pi |
infinity |
-infinity |
NaN
CSS Values and Units Module Level 4 . . .

abs() . CSS --font-size font-size . abs() .

css
h1 {
  font-size: abs(var(--font-size));
}

abs() . -45deg . abs() .

css
div {
  --deg: -45deg;
  background-image: linear-gradient(abs(var(--deg)), blue, red);
}

CSS abs() CSS max() . .

css
p {
  line-height: max(var(--lh), -1 * var(--lh));
}

max() var(--lh) -1 * var(--lh) . --lh , .

Specification
CSS Values and Units Module Level 4
# sign-funcs


Web Proxy Viewer  |  New URL  |  Original Page