پیشنمایش زنده
کد HTML
<button>
<span>BUTTON</span>
</button>
کد CSS
button {
position: relative;
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
background: #183153;
font-family: "Montserrat", sans-serif;
box-shadow: 0px 6px 24px 0px rgba(0, 0, 0, 0.2);
overflow: hidden;
cursor: pointer;
border: none;
}
button:after {
content: " ";
width: 100%;
height: 0%;
background: #ffd401;
position: absolute;
transition: all 0.4s ease-in-out;
bottom: 0;
border-radius: 0%;
transform: scale(1);
transition-duration: 0.4s, 0.2s, 0.2s, 0.4s;
}
button:hover::after {
bottom: auto;
top: 0;
height: 100%;
border-radius: 50%;
transform: scale(1.5);
}
button span {
text-align: center;
text-decoration: none;
width: 100%;
padding: 18px 25px;
color: #fff;
font-size: 1.125em;
font-weight: 700;
letter-spacing: 0.3em;
z-index: 20;
transition: all 0.3s ease-in-out;
}
button:hover span {
color: #183153;
animation: scaleUp 0.3s ease-in-out;
}
@keyframes scaleUp {
0% {
transform: scale(1);
}
50% {
transform: scale(0.95);
}
100% {
transform: scale(1);
}
}