본문 바로가기
CSS

animation 애니메이션 css

by 영감은어디에 2024. 5. 5.
div {
  width: 100px;
  height: 100px;
  background-color: red;
  position: relative;
  animation: myfirst 5s linear 2s infinite alternate;
}

div {
  width: 100px;
  height: 100px;
  background-color: red;
  position: relative;
  animation-name: example;
  animation-duration: 5s;
  animation-timing-function: linear;
  animation-delay: 2s;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

@keyframes myfirst {
  0%   {background-color:red; left:0px; top:0px;}
  25%  {background-color:yellow; left:200px; top:0px;}
  50%  {background-color:blue; left:200px; top:200px;}
  75%  {background-color:green; left:0px; top:200px;}
  100% {background-color:red; left:0px; top:0px;}
}

https://www.w3schools.com/css/tryit.asp?filename=trycss3_animation5


animation-fill-mode: forwards;

https://www.w3schools.com/css/tryit.asp?filename=trycss3_animation_fill-mode


 

animation-fill-mode: both;

https://www.w3schools.com/css/tryit.asp?filename=trycss3_animation_fill-mode3


처음으로 가서 멈춤 

animation-fill-mode: backwards;

https://www.w3schools.com/css/tryit.asp?filename=trycss3_animation_fill-mode2


animation-direction: alternate;

https://www.w3schools.com/css/tryit.asp?filename=trycss3_animation_direction2

 

'CSS' 카테고리의 다른 글

input radio 라디오버튼 모양 바꾸기  (0) 2024.05.08
input date icon 달력 모양 바꾸기  (0) 2024.05.08
header nav  (0) 2024.05.05
로컬에서 작업중 부트스트랩 등 cdn 연결 안될때  (0) 2024.05.02
로티파일 html 에 넣기  (0) 2024.04.29