728x90
๋ฐ์ํ
๐ก ์ค์ต ํฌ์ธํธ!
๐ ํ๋คํ๋ค ๋ฒํผ
<button class="ani-button">ํ๋คํ๋ค</button>
.ani-button {
padding: 15px 20px;
font-size: 20px;
background: skyblue;
color: white;
border: none;
border-radius: 5px;
display: block;
margin: 30px auto;
cursor: pointer;
}
.ani-button:hover {
animation-name: shake;
animation-duration: 1s;
}
@keyframes shake {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(-8deg);
}
50% {
transform: rotate(8deg);
}
75% {
transform: rotate(-8deg);
}
100% {
transform: rotate(0deg);
}
}
๐ ํ์ ํ๋ + ๋ฒํผ
<div class="ani-x">+</div>
.ani-x {
margin: 150px auto;
text-align: center;
font-size: 70px;
width: 84px;
cursor: pointer;
}
.ani-x:hover {
animation-name: turn;
animation-duration: 1s;
animation-fill-mode: forwards;
}
@keyframes turn {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(-15deg);
}
100% {
transform: rotate(45deg) scale(1.5);
}
}
๐ ์ฌ๋ผ์ด๋๋๋ ๊ฒ์ ๋ฉ๋ด
<nav class="ani-navbar">
<h4>Menu</h4>
<p>Item1</p>
<p>Item2</p>
<p>Item3</p>
</nav>
.ani-navbar {
width: 200px;
background: black;
color: white;
height: 100%;
padding: 25px;
position: fixed;
z-index: 5;
text-align: right;
transition: all 1s;
transform: translateX(-180px);
}
.ani-navbar:hover {
transform: translateX(0px);
text-align: center;
cursor: pointer;
}
@keyframes slide {
0% {
transform: translateX(-250px);
}
50% {
transform: translateX(50px) skewX(-30deg);
}
100% {
transform: translateX(0px);
}
}
.ani-navbar:hover p {
animation-name: slide;
animation-duration: 1s;
padding: 10px 15px;
}
728x90
๋ฐ์ํ
'[๊ฐ๋ฐ] Practice > HTML CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[HTML/CSS] grid-column, grid-row ์ผ๋ก ๋ ์ด์์ ๋ง๋ค๊ธฐ (0) | 2022.03.02 |
---|---|
[HTML/CSS] Grid ๋ฐ์ํ ๋ ์ด์์ ๋ง๋ค๊ธฐ (0) | 2022.03.02 |
[HTML/CSS] HTML Video, Audio ๋ค๋ฃจ๊ธฐ (0) | 2022.03.01 |
[HTML/CSS] SCSS ๋ก row, col ๋ง๋ค๊ธฐ (0) | 2022.03.01 |
[HTML/CSS] SCSS ๋ก Alert ๋ฐ์ค ๋ง๋ค๊ธฐ (0) | 2022.03.01 |