animation-fill-mode
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since â¨2015ë 9ìâ©.
animation-fill-mode CSS ìì±ì CSS ì ëë©ì´ì
ì´ ì¤í ì ê³¼ íì ëìì ì¤íì¼ì ì ì©íë ë°©ë²ì ì§ì í©ëë¤.
/* Single animation */
animation-fill-mode: none;
animation-fill-mode: forwards;
animation-fill-mode: backwards;
animation-fill-mode: both;
/* Multiple animations */
animation-fill-mode: none, backwards;
animation-fill-mode: both, forwards, none;
ì¶ì½ ìì± animationì ì¬ì©íì¬ ëª¨ë ì ëë©ì´ì
ìì±ì í꺼ë²ì ì¤ì íë ê²ì´ í¸ë¦¬í©ëë¤.
| ì´ê¸°ê° | none |
|---|---|
| ì ì©ëì | all elements, ::before and ::after pseudo-elements |
| ìì | no |
| ê³ì° ê° | as specified |
| Animation type | Not animatable |
문ë²(Syntax)
>ê°(Values)
none-
ì ëë©ì´ì ì ì¤íëì§ ìì ë ëìì ì¤íì¼ì ì ì©íì§ ììµëë¤. ììë ëì ì ì©ë ë¤ë¥¸ CSS ê·ì¹ì ì¬ì©íì¬ íìë©ëë¤. ì´ê²ì 기본ê°ì ëë¤.
forwards-
ëìì ì¤í ë ì ëë©ì´ì ì ë§ì§ë§ keyframeì ìí´ ì¤ì ë ê³ì° ë ê°ì ì ì§í©ëë¤. ë§ì§ë§ í¤ íë ìì
animation-directionë°animation-iteration-countì ê°ì ë°ë¼ ë¤ë¦ ëë¤.animation-directionanimation-iteration-countlast keyframe encountered normaleven or odd 100%ortoreverseeven or odd 0%orfromalternateeven 0%orfromalternateodd 100%ortoalternate-reverseeven 100%ortoalternate-reverseodd 0%orfrom backwards-
ì ëë©ì´ì ì ëìì ì ì©ëë ì¦ì 첫 ë²ì§¸ ê´ë ¨ keyframe ì ì ì ë ê°ì ì ì©íê³
animation-delayê¸°ê° ëì ì´ ê°ì ì ì§í©ëë¤. 첫 ë²ì§¸ ê´ë ¨ í¤íë ììanimation-directionì ê°ì ë°ë¼ ë¤ë¦ ëë¤.animation-directionfirst relevant keyframe normaloralternate0%orfromreverseoralternate-reverse100%orto both-
ì ëë©ì´ì ì ìë¤ ì쪽 모ëì ê·ì¹ì ë°ë¥´ë¯ë¡ ì ëë©ì´ì ìì±ì´ ìë°©í¥ì¼ë¡ íì¥ë©ëë¤.
ì°¸ê³ :
animation- * ìì±ì ì¬ë¬ ê°ì ì¼íë¡ êµ¬ë¶ ë ê°ì ì§ì íë©´ animation-name ìì±ì ì§ì ë ì ëë©ì´ì
ì í ë¹ëë ê°ì ìì ë°ë¼ ë¤ë¥¸ ë°©ìì¼ë¡ ì§ì ë©ëë¤. ìì¸í ë´ì©ì ì¬ë¬ ì ëë©ì´ì
ìì± ê° ì¤ì ì 참조íììì¤.
Formal syntax
animation-fill-mode =
<single-animation-fill-mode>#
<single-animation-fill-mode> =
none |
forwards |
backwards |
both
ìì (Examples)
ë¤ì ìì ìì animation-fill-modeì í¨ê³¼ë¥¼ ë³¼ ì ììµëë¤. 무í ìê° ëì ì¤íëë ì ëë©ì´ì ì ê²½ì° ìë ìí (기본ê°)ë¡ ëë리기보ë¤ë ìµì¢ ìíë¡ ì ì§íë ë°©ë²ì ë³´ì¬ì¤ëë¤.
HTML
<p>íì ë°ì¤ ìì ë§ì°ì¤ë¥¼ ì¬ë ¤ë³´ì¸ì!</p>
<div class="demo">
<div class="grows">ì´ ê¸ì¨ë 커ì§ëë¤.</div>
<div class="growsandstays">ì´ ê¸ì¨ë 커ì§ë©°, ì»¤ì§ ìí를 ì ì§í©ëë¤.</div>
</div>
CSS
.demo {
border-top: 100px solid #ccc;
height: 300px;
}
@keyframes grow {
0% {
font-size: 0;
}
100% {
font-size: 40px;
}
}
.demo:hover .grows {
animation-name: grow;
animation-duration: 3s;
}
.demo:hover .growsandstays {
animation-name: grow;
animation-duration: 3s;
animation-fill-mode: forwards;
}
ìì¸í ìì ë CSS animations를 ë³´ììì¤.
ëª ì¸
| Specification |
|---|
| CSS Animations Level 1 > # animation-fill-mode > |
ë¸ë¼ì°ì í¸íì±(Browser compatibility)
ê°ì´ 보기(See also)
- Using CSS animations
- JavaScript
AnimationEventAPI