Dán CSS sau:
.button {
position: relative;
display: inline-block;
padding: 12px 24px;
font-size: 16px;
font-weight: bold;
color: white;
background: #007bff;
border: none;
border-radius: 8px;
cursor: pointer;
overflow: hidden; /* Ẩn phần dư của hiệu ứng */
text-transform: uppercase;
}
.button:hover {
background: #0056b3;
}
.button::before {
content: "";
position: absolute;
top: 0;
left: -100%;
width: 50%;
height: 100%;
background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 100%);
transform: skewX(-25deg);
}
.button:hover::before {
animation: shine 0.75s;
}
@keyframes shine {
100% { left: 150%; }
}
🔥 Khi di chuột vào button, hiệu ứng ánh sáng quét ngang qua tạo cảm giác chuyên nghiệp!
Chào ! Bạn thấy nội dung này thế nào?





