<time>
CSS 자료형은 시간 값을 초나 밀리초 단위로 나타냅니다. animation
, transition
과 관련 속성에서 사용합니다.
구문
<time>
자료형은 <number>
와, 그 뒤에 붙는 아래 단위 중 하나로 이루어져 있습니다. 선택 사항으로 하나의 +
또는 -
기호를 맨 앞에 붙일 수 있습니다. 다른 모든 수치와 마찬가지로 단위와 숫자 사이에는 공백이 없습니다.
참고: 0
은 단위와 상관 없이 언제나 동일하지만 시간 단위를 생략할 수 없습니다. 즉 0
은 유효하지 않은 구문이며 0s
나 0ms
를 나타내지 않습니다.
단위
s
- 시간을 초 단위로 나타냅니다. 예시:
0s
,1.5s
,-60s
. ms
- 시간을 밀리초 단위로 나타냅니다. 예시:
0ms
,150.25ms
,-60000ms
.
참고: s
와 ms
의 변환은 1s
= 1000ms
를 따릅니다.
예제
유효한 시간
12s 양의 정수 -456ms 음의 정수 4.3ms 정수 아닌 실수 14mS 단위는 대소문자 구분을 하지 않지만, 대문자는 추천하지 않음 +0s + 뒤의 0과 단위 -0ms - 뒤의 0과 단위
유효하지 않은 시간
0 <length>는 단위 없는 0을 받을 수 있지만, <time>은 불가능 12.0 단위가 없으므로 <number>지만 <time>이 아님 7 ms 수와 단위 사이에 공백은 불허
명세
Specification | Status | Comment |
---|---|---|
CSS Values and Units Module Level 4 The definition of '<time>' in that specification. |
Editor's Draft | |
CSS Values and Units Module Level 3 The definition of '<time>' in that specification. |
Candidate Recommendation | Normative definition of s and ms . |
CSS Level 2 (Revision 1) The definition of '<time>' in that specification. |
Recommendation | Informal definition of s and ms . |
브라우저 호환성
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.