پیشنمایش زنده
کد HTML
<button class="button">
<span>PLAY NOW</span>
</button>
کد CSS
.button {
border: none;
position: relative;
width: 180px;
height: 60px;
padding: 0;
z-index: 2;
clip-path: polygon(
0% 25%,
25% 0%,
75% 0%,
100% 25%,
100% 75%,
75% 100%,
25% 100%,
0% 75%
);
cursor: pointer;
background-color: transparent;
transform: translateY(6px);
}
.button:after {
content: "";
position: absolute;
left: -10px;
right: -10px;
top: -10px;
bottom: -10px;
border: 2px solid #ff0066;
opacity: 0;
transition: all 0.5s ease;
transform: scale(0.9);
}
.button:hover:after {
opacity: 1;
transform: scale(1);
}
.button span {
position: absolute;
width: 100%;
font-size: 14px;
font-weight: 700;
left: 50%;
top: 50%;
letter-spacing: 2px;
text-align: center;
transform: translate(-50%, -50%);
color: #ff0066;
transition: all 0.5s ease;
}
.button:hover span {
color: #fff;
}
.button:before {
content: "";
position: absolute;
width: 0;
height: 100%;
background-color: #ff0066;
left: 0;
top: 0;
transition: all 0.4s ease-out;
z-index: -1;
}
.button:hover:before {
width: 100%;
}