<number>

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

<number> CSS 자료형은 숫자, 즉 정수 또는 실수를 표현합니다.

구문

<number> 구문은 <integer> 구문을 확장합니다. 소수점 이하 값은 . 뒤로 한 개 이상의 10진수 숫자를 붙여 표현하며, 정수 뒤에 이어 붙일 수 있습니다. 따로 연관지어야 하는 단위는 없습니다.

보간

애니메이션에서 <number> 자료형의 값은 유동소수점 실수를 사용해 보간합니다. 보간의 속도는 애니메이션과 연결된 timing function이 결정합니다.

예제

유효한 숫자

12          <integer>는 <number>
4.01        양의 실수
-456.8      음의 실수
0.0         0
+0.0        0, 양의 부호
-0.0        0, 음의 부호
.60         앞의 0 없는 소수점 이하 값
10e3        과학적 표기법
-3.4e-2     복잡한 과학적 표기법

유효하지 않은 숫자

12.         소수점 뒤에 최소 하나의 숫자가 존재해야 함
+-12.2      하나의 +/-만 허용
12.1.1      하나의 소수점만 허용

명세

Specification
CSS Values and Units Module Level 4
# numbers

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
<number>
Scientific notation

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

같이 보기