CSS Transition

2020/CSS 2020. 2. 16. 18:33
반응형

https://developer.mozilla.org/en-US/docs/Web/CSS/transition

 

transition

The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay.

developer.mozilla.org

 

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Transitions</title>
  <style>
  .box{
    background-color: green;
    /*color:white;
    transition:all을 하면 위의 bgcolor와 color 둘다 효과가 적용됨.
    하나만 하고 싶으면 color 이렇게 하나만 적어주면 됩니다
    범위 시간 효과;*/
    transition:all .5s ease-in-out;
  }
  /*state중에서 hover, focus,active에만 적용됩니다. */
  .box:hover{
    background-color: red;
    color:blue;
  }
  </style>
</head>
<body>
  <span class="box">
    Text
  </span>
</body>
</html>

출처: nomadcoder

반응형

'2020 > CSS' 카테고리의 다른 글

css animation @keyframes  (0) 2020.02.16
CSS Transformations  (0) 2020.02.16
css states(hover, active, focus, visited)  (0) 2020.02.16
PSEUDO SELECTOR  (0) 2020.02.16
NTH TEST SITE  (0) 2020.02.16
블로그 이미지

꽃꽂이하는개발자

,