2. CSS

CSS Animations (애니메이션) 사용하기

도피디 2024. 12. 9. 23:02
반응형

우리는 원하는 만큼 애니메이션을 만들고 재생시킬 수 있다.

 

<!DOCTYPE html>
<html lang="kr">
<head>
<title>The Nick Times</title>
<style>
@keyframes superSexyCoinFlip {
from {
transform: rotateX(0);
}
to {
transform: rotateY(360deg);
}
}
img {
border: 10px solid black;
border-radius: 50%;
animation: superSexyCoinFlip 5s ease-in-out;
}
</style>
</head>
<body>
<img src="img/pic.jpg" />
</body>
</html>

 

 

 

 

 

결과

 

 

마우스 오버를 하지 않아도 이미지가 로테이트 된다.

 


(참고) ease-in-out 다음에 infinite 를 넣으면 무제한 반복됨 ㅋㅋ

반응형