transition

유석현(SeokHyun Yu)·2022년 11월 15일
0

CSS

목록 보기
31/32
post-thumbnail
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      a {
        font-size: 4rem;
        /* transition 효과는 block이나 inline-block만 가능하다 */
        display: inline-block;
        /* 장면 전환 효과를 누구한테 줄것인가 */
        transition-property: all; /* = font-size transform */
        transition-duration: 0.3s;
        /* = transition: all 0.3s */
        /* transition: font-size 1s, transform 0.1s; */
      }
      a:active {
        transform: translate(20px, 20px);
        font-size: 2rem;
      }
    </style>
  </head>
  <body>
    <a href="#">Click</a>
  </body>
</html>


profile
Backend Engineer

0개의 댓글