μ λλ©μ΄μ μμ±
μμμ μμ§μμ μ§μ νκ³ νλ μλ³ μ€νμΌμ μ§μ νμ¬ μ λλ©μ΄μ
ν¨κ³Όλ₯Ό μ£Όλ μμ±
β’
μ λλ©μ΄μ
μμ±μ μ’
λ₯
β’
κΈ°λ³Έ μμμ½λ
β’
μ λλ©μ΄μ
μμ± μμ©
μ λλ©μ΄μ μμ±μ μ’ λ₯
μμ± | μ€λͺ
| κΈ°λ³Έ μμ μ½λ |
animation | μ λλ©μ΄μ
μ μ μ©ν μμμ μμ±μ μ€μ ν©λλ€. | animation: name duration timing-function delay iteration-count direction; |
animation-name | μ λλ©μ΄μ
μ μ΄λ¦μ μ μν©λλ€. | animation-name: slide; |
animation-duration | μ λλ©μ΄μ
μ μ§μ μκ°μ μ€μ ν©λλ€. | animation-duration: 2s; |
animation-timing-function | μ λλ©μ΄μ
μ μλ 곑μ μ μ€μ ν©λλ€. | animation-timing-function: ease-in; |
animation-delay | μ λλ©μ΄μ
μμ μ μ§μ° μκ°μ μ€μ ν©λλ€. | animation-delay: 1s; |
animation-iteration-count | μ λλ©μ΄μ
μ λ°λ³΅ νμλ₯Ό μ€μ ν©λλ€. | animation-iteration-count: infinite; |
animation-direction | μ λλ©μ΄μ
μ μ§ν λ°©ν₯μ μ€μ ν©λλ€. | animation-direction: alternate; |
animation-fill-mode | μ λλ©μ΄μ
μ’
λ£ ν μμμ μ€νμΌμ μ€μ ν©λλ€. | animation-fill-mode: forwards; |
κΈ°λ³Έ μμ μ½λ
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>μ λλ©μ΄μ
μμ± μμ</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
text-align: center;
padding: 50px;
background-color: #f0f0f0;
}
/* μ λλ©μ΄μ
μ μ */
@keyframes slide {
0% { transform: translateX(0); }
100% { transform: translateX(100px); }
}
/* μ λλ©μ΄μ
μ μ© */
.animation-example {
width: 150px;
height: 150px;
background-color: lightcoral;
margin: 20px auto;
display: inline-block;
animation: slide 2s ease-in-out 1s infinite alternate;
}
</style>
</head>
<body>
<div class="animation-example"></div>
</body>
</html>
HTML
볡μ¬
μ΄ μ½λλ @keyframes κ·μΉμ μ¬μ©νμ¬ slide μ λλ©μ΄μ
μ μ μνκ³ , μ΄λ₯Ό .animation-example ν΄λμ€μ μ μ©ν©λλ€. μ λλ©μ΄μ
μ μ΄λ¦, μ§μ μκ°, νμ΄λ° ν¨μ, μ§μ° μκ°, λ°λ³΅ νμ λ° λ°©ν₯μ μ€μ νμ¬ μμμ μμ§μμ μ μ΄ν©λλ€.