CSS μ λλ©μ΄μ : ν΅ν΅ νλ κΈμ
μ€λμ κΈμλ€μ΄ λλ μ΄λ₯Ό λκ³ ν΅ν΅ νλ λ―ν μ λλ©μ΄μ μ΄ λνλλλ‘ μμ ν΄ λ³΄κ² μ΅λλ€. μμ ν΄λ³Ό μ λλ©μ΄μ μ λ€μκ³Ό κ°μ΅λλ€.
See the Pen Text animation02 by mj0614k (@mj0614k) on CodePen.
1. HTML μμ€
<h1>
<span>M</span>
<span>I</span>
<span>N</span>
<span>J</span>
<span>E</span>
<span>O</span>
<span>N</span>
<span>G</span>
</h1>
h1 νκ·Έ μμ μνλ κΈμ μλ§νΌ span νκ·Έλ₯Ό μμ±νκ³ , κΈμλ₯Ό ν μμ© μ λ ₯ν΄ μ€λλ€.
2. CSS μμ€
html, body {
width: 100%;
height: 100%;
background: linear-gradient(140deg, skyblue 0%, plum 100%);
display: flex;
justify-content: center;
align-items: center;
}
h1 {
height: 100px;
}
h1 span{
font-family: 'serif';
font-size: 80px;
color: #fff;
position: relative;
top: 20px;
display: inline-block;
-webkit-font-smoothing: antialiased;
text-shadow: 0 1px 0 #ccc,
0 2px 0 #ccc,
0 3px 0 #ccc,
0 4px 0 #ccc,
0 5px 0 #ccc,
0 6px 0 transparent,
0 7px 0 transparent,
0 8px 0 transparent,
0 9px 0 transparent,
0 10px 10px rgba(0,0,0,0.4);
animation: bounce 0.3s ease infinite alternate;
}
h1 span:nth-child(2) {
animation-delay: 0.1s;
}
h1 span:nth-child(3) {
animation-delay: 0.2s;
}
h1 span:nth-child(4) {
animation-delay: 0.3s;
}
h1 span:nth-child(5) {
animation-delay: 0.4s;
}
h1 span:nth-child(6) {
animation-delay: 0.5s;
}
h1 span:nth-child(7) {
animation-delay: 0.6s;
}
h1 span:nth-child(8) {
animation-delay: 0.7s;
}
@keyframes bounce {
100% {
top: -20px;
text-shadow: 0 1px 0 #ccc,
0 2px 0 #ccc,
0 3px 0 #ccc,
0 4px 0 #ccc,
0 5px 0 #ccc,
0 6px 0 transparent,
0 7px 0 transparent,
0 8px 0 transparent,
0 9px 0 transparent,
0 50px 25px rgba(0,0,0,0.4);
}
}
λ°°κ²½μμ μμκ² κ·ΈλΌλ°μ΄μ
μ ν΄ μ€λλ€. κΈμλ€μ΄ κ°μ΄λ°μ μμΉνλλ‘ μ λ ¬ν΄
μ£Όκ³ , κ·Έλ¦Όμλ₯Ό λ§λ€μ΄ μ€λλ€.
font-smoothing: antialiased μμ±μ μ¬μ©νλ©΄ κΈμλ₯Ό λΆλλ½κ² λ§λ€μ΄
μ€λλ€.
keyframesλ₯Ό μ¬μ©νμ¬ μμΉμ κ·Έλ¦Όμ μ λλ©μ΄μ
μ μμ
ν΄ μ€λλ€.
μμ HTML, CSS μμ€λ₯Ό ν©μΉλ©΄ μ λλ©μ΄μ μ΄ μμ±λ©λλ€. μμμ£ ?
'CSS' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
CSS μ λλ©μ΄μ λ§λ€κΈ° : λ‘λ© μ λλ©μ΄μ (6) | 2022.09.24 |
---|---|
CSS μ λλ©μ΄μ λ§λ€κΈ° : 3D λ°μ€ μ λλ©μ΄μ (9) | 2022.09.22 |
CSS μ λλ©μ΄μ λ§λ€κΈ° : μΉ΄λ λ€μ§κΈ° (9) | 2022.09.20 |
CSS μ λλ©μ΄μ λ§λ€κΈ° : μΌλ μ΄λ μ λλ©μ΄μ (8) | 2022.09.19 |
CSS μ λλ©μ΄μ λ§λ€κΈ° : GIF μ΄λ―Έμ§ μ λλ©μ΄μ ꡬννκΈ° (9) | 2022.09.08 |
λκΈ