๐ HTML,CSS
HTML&CSS 21์ผ์ฐจ (์ ๋ฆฌx)
Genie_.
2024. 3. 23. 22:15
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
๋ฐ์ํ