--- title: <time> slug: Web/CSS/time tags: - CSS - CSS Date Type - Reference - Web translation_of: Web/CSS/time --- <div>{{CSSRef}}</div> <p><strong><code><time></code></strong> <a href="/ko/docs/Web/CSS">CSS</a> <a href="/ko/docs/Web/CSS/CSS_Types">자료형</a>은 시간 값을 초나 밀리초 단위로 나타냅니다. {{cssxref("animation")}}, {{cssxref("transition")}}과 관련 속성에서 사용합니다.</p> <h2 id="구문">구문</h2> <p><code><time></code> 자료형은 {{cssxref("<number>")}}와, 그 뒤에 붙는 아래 단위 중 하나로 이루어져 있습니다. 선택 사항으로 하나의 <code>+</code> 또는 <code>-</code> 기호를 맨 앞에 붙일 수 있습니다. 다른 모든 수치와 마찬가지로 단위와 숫자 사이에는 공백이 없습니다.</p> <div class="note"> <p><strong>참고:</strong> <code>0</code>은 단위와 상관 없이 언제나 동일하지만 시간 단위를 생략할 수 없습니다. 즉 <code>0</code>은 유효하지 않은 구문이며 <code>0s</code>나 <code>0ms</code>를 나타내지 않습니다.</p> </div> <h3 id="단위">단위</h3> <dl> <dt><strong><code id="s">s</code></strong></dt> <dd>시간을 초 단위로 나타냅니다. 예시: <code>0s</code>, <code>1.5s</code>, <code>-60s</code>.</dd> <dt><strong><code id="ms">ms</code></strong></dt> <dd>시간을 밀리초 단위로 나타냅니다. 예시: <code>0ms</code>, <code>150.25ms</code>, <code>-60000ms</code>.</dd> </dl> <div class="note"> <p><strong>참고:</strong> <code>s</code>와 <code>ms</code>의 변환은 <code>1s</code> = <code>1000ms</code>를 따릅니다.</p> </div> <h2 id="예제">예제</h2> <h3 id="유효한_시간">유효한 시간</h3> <pre>12s 양의 정수 -456ms 음의 정수 4.3ms 정수 아닌 실수 14mS 단위는 대소문자 구분을 하지 않지만, 대문자는 추천하지 않음 +0s + 뒤의 0과 단위 -0ms - 뒤의 0과 단위 </pre> <h3 id="유효하지_않은_시간">유효하지 않은 시간</h3> <pre class="example-bad">0 <length>는 단위 없는 0을 받을 수 있지만, <time>은 불가능 12.0 단위가 없으므로 <number>지만 <time>이 아님 7 ms 수와 단위 사이에 공백은 불허 </pre> <h2 id="명세">명세</h2> <table class="standard-table"> <thead> <tr> <th scope="col">Specification</th> <th scope="col">Status</th> <th scope="col">Comment</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('CSS4 Values','#time','<time>')}}</td> <td>{{Spec2('CSS4 Values')}}</td> <td></td> </tr> <tr> <td>{{SpecName('CSS3 Values','#time','<time>')}}</td> <td>{{Spec2('CSS3 Values')}}</td> <td>Normative definition of <code>s</code> and <code>ms</code>.</td> </tr> <tr> <td>{{SpecName('CSS2.1','aural.html#times','<time>')}}</td> <td>{{Spec2('CSS2.1')}}</td> <td>Informal definition of <code>s</code> and <code>ms</code>.</td> </tr> </tbody> </table> <h2 id="브라우저_호환성">브라우저 호환성</h2> <p>{{Compat("css.types.time")}}</p>