CSS

트랜지션

은찡안찡 2022. 11. 16. 15:33

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=x, initial-scale=1.0">
  <title>트랜지션</title>
  <style>
    h2{
      padding-top: 50px;
     text-align: center;text-transform: uppercase;
    }
    .demo {
      position:relative; left: 50%;
      width: 800px;height: 500px;margin:100px 0 100px -400px;
      border-left: 5px dashed #009;
      border-right: 5px solid red;
    }
    .box{/*자식요소에 대한 공통 스타일 시트*/
      position: absolute; left: 0;
      width: 80px;height: 80px;
      font-size: 8px; text-align: center;line-height: 65px; text-transform: uppercase;
      border: 5px solid #090; border-radius: 50%;
    }
    /*↓자식요소에 대한 개별 스타일 시트*/
    .lenear{
      top:0;
      background: #FCF;
      transition:all 2.0s linear;
    }
    .ease{
      top:100px;
      background: #F9F;
      transition:all 2.0s ease;
    }
    .ease-in{
      top:200px;
      background : #F6F;
      transition:all 2.0s ease-in;
    }
    .ease-out{
      top:300px;
      background: #F3F;
      transition:all 2.0s ease-out;
    }
    .ease-in-out{
      top:400px;
      background: #F0F;
      transition:all 2.0s ease-in-out;
    }

    .demo:hover .box{left: 720px;}
  </style>
</head>
<body>
  <h2>transition timing function</h2>
  <div class="demo">
      <div class="box linear"><p>lenear</p></div>
      <div class="box ease"><p>ease</p></div>
      <div class="box ease-in"><p>ease-in</p></div>
      <div class="box ease-out"><p>ease-out</p></div>
      <div class="box ease-in-out"><p>ease-in-out</p></div>
      </div>
  </div>
</body>
</html>

'CSS' 카테고리의 다른 글

애니메이션(2)  (0) 2022.11.16
애니메이션(1)  (0) 2022.11.16
트렌스폼3D  (0) 2022.11.16
트렌스폼  (0) 2022.11.16
테이블  (0) 2022.11.16