728x90
반응형
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>애니메이션</title>
</head>
<style>
div {
width: 200px;
height: 200px;
background-color: #d4ffca;
border-radius: 50%;
border-width: 10px;
border-style: solid;
border-top-color: red;
border-right-color: purple;
border-bottom-color: blue;
border-left-color: orange;
animation-name: ball;
animation-duration: 1s;
/*animation-fill-mode: ;*/
/*animation-direction: in;*/
animation-iteration-count: infinite;
animation-timing-function: linear;
/* alternate: 애니메이션이 끊김없이 이어짐
reverse: 애니메이션이 역으로 동작함 */
animation-direction: alternate;
}
@keyframes ball { /* ball자리 이름은 하고싶은거 해도됨 */
from{ /* 내가 정의하고 싶은 처음 모습 */
background-color: #e3c8ff;
}
30%{
background-color: #ffd6de
}
50%{
transform: translateX(500px) rotate(180deg) scale(-200%);
}
60%{
background-color: orange;
}
to{ /* 내가 정의하고 싶은 마지막 모습 */
transform: translateX(1000px) rotate(360deg) scale(200%);
}
}
</style>
<body>
<div></div>
</body>
</html>
728x90
반응형
'💜 HTML,CSS' 카테고리의 다른 글
HTML&CSS 23일차 (정리x) (0) | 2024.03.23 |
---|---|
HTML&CSS 22일차 (정리x) (0) | 2024.03.23 |
HTML&CSS 실습7 (정리x) (0) | 2024.03.23 |
HTML&CSS 20일차 (정리x) (0) | 2024.03.23 |
HTML&CSS 19일차 (정리x) (0) | 2024.03.23 |