728x90
CSS : ์ ๋๋ฉ๋์ ๋ง๋ค๊ธฐ : ๋น๊ธ๋น๊ธ ๋ก๋ฉ ์ ๋๋ฉ์ด์
์ด๋ฒ ์๊ฐ์๋ CSS ์ค์ต์ผ๋ก ์์๊ฐ ๋์๊ฐ๋ค๊ฐ ๋น๊ธ๋น๊ธ ๋์๊ฐ๋ ๋ก๋ฉ ์ ๋๋ฉ์ด์ ์ ๋ง๋ค์ด๋ณด๊ฒ ์ต๋๋ค~~!
#1. HTML
์์ ๊ฐฏ์ ๋งํผ div๋ฅผ ๋ฃ์ด์ฃผ์๋ฉด ๋ฉ๋๋ค.
<div class="loader">
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
</div>
#2. CSS
๋ค์์ CSS ์ฝ๋ ์ ๋๋ค!
body {
background: DarkSeaGreen;
}
.loader {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100px;
height: 100px;
animation: spin .6s linear infinite reverse;
}
.ball {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: 100%;
animation: spin 1s infinite ease-in-out
}
.ball:after {
position: absolute;
content: '';
background-color: #fff;
width: 5px;
height: 5px;
border-radius: 100%;
top: 0;
}
.ball:nth-child(2) {
animation-delay: -0.1s;
}
.ball:nth-child(3) {
animation-delay: -0.2s;
}
.ball:nth-child(4) {
animation-delay: -0.3s;
}
.ball:nth-child(5) {
animation-delay: -0.4s;
}
.ball:nth-child(6) {
animation-delay: -0.5s;
}
.ball:nth-child(7) {
animation-delay: -0.6s;
}
.ball:nth-child(8) {
animation-delay: -0.7s;
}
.ball:nth-child(9) {
animation-delay: -0.8s;
}
.ball:nth-child(10) {
animation-delay: -0.9s;
}
@keyframes spin {
0% {
transform: translate(-50%, -50%) rotate(0deg);
}
100% {
transform: translate(-50%, -50%) rotate(360deg);
}
}
#3. ๊ฒฐ๊ณผ๋ณด๊ธฐ
728x90
'CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[CSS] ์ ๋๋ฉ์ด์ 09 : ์ปค์๋ฐ๋ผ ์์ง์ด๋ EYES~~๐ (2) | 2022.09.29 |
---|---|
[CSS] ์ ๋๋ฉ์ด์ 07 : ์ญ์ฐ์ฐ์ฐ์ฑ ๋์ด๋๋ ๋ฐ์ค (2) | 2022.09.29 |
[CSS] ์ ๋๋ฉ์ด์ 06 : ํต!ํต!ํต! ํ ์คํธ (2) | 2022.09.29 |
[CSS] ์ ๋๋ฉ์ด์ 05 : ๊น์ฆค๋๋ ์ ์ฒด ํจ๊ณผ (5) | 2022.09.21 |
[CSS] ์ ๋๋ฉ์ด์ 04 : ์จ์ด๋ธ~~์จ์ด๋ธ~~ (6) | 2022.09.19 |
๋๊ธ