웹프로그래밍 CSS3/CSS 애니메이션

애니메이션 4

별초롱언니 2025. 3. 17. 14:16

▣ 애니메이션의 타이밍 설정하기

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>애니메이션의 타이밍 설정하기</title>
  <style>
    div {
      width: 100px;
      height: 100px;
      background-color: red;
      color: white;
      position: relative;
      animation: boxmove 5s alternate;
    }
    #box1 {
      animation-delay: 1s;
      animation-iteration-count: 3;
      animation-timing-function: ease;
    }
    #box2 {
      animation-delay: 2s;
      animation-iteration-count: 3;
      animation-timing-function: linear;
    }
    #box3 {
      animation-delay: 3s;
      animation-iteration-count: 3;
      animation-timing-function: ease-out;
    }
    @keyframes boxmove {
      from {
        left: 0px;
      }
      to {
        left: 300px;
      }
    }
  </style>
</head>
<body>
  <div id="box1">애니메이션 박스 1</div>
  <div id="box2">애니메이션 박스 2</div>
  <div id="box3">애니메이션 박스 3</div>
  <p><strong>참고 : </strong>IE9 이하 혹은 낮은 버전에서는 지원하지 않습니다. </p>
</body>
</html>

'웹프로그래밍 CSS3 > CSS 애니메이션' 카테고리의 다른 글

애니메이션 6  (0) 2025.03.18
애니메이션 5  (0) 2025.03.18
애니메이션 3  (0) 2025.03.17
애니메이션 2  (0) 2025.03.17
애니메이션 1  (0) 2025.03.17