CSS кнопка з анімаційним ефектом що світиться
- Останнє оновлення: 3 Листопада 2023 р.
- Перегляди: 51
- Автор: Адмін

Колеги всім привіт.
Створюємо на чистому CSS без використання JavaScript коду красиву кнопку з анімаційним ефектом, що світиться.
HTML код:
<body>
<a href="#">Button</a>
</body>
Код CSS:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #112233;
}
a {
transform: translate(-50%, -50%);
width: 300px;
height: 80px;
text-align: center;
line-height: 80px;
color: #ffffff;
font-size: 25px;
text-transform: uppercase;
text-decoration: none;
box-sizing: border-box;
background: linear-gradient(90deg, #44BBFF, #EDD834, #FC575E, #44BBFF);
background-size: 400%;
border-radius: 10px;
animation: button-animate 8s linear infinite;
}
@keyframes button-animate {
0% {
background-position: 0%;
}
100% {
background-position: 400%;
}
}
a:before {
position: absolute;
top: -5px;
left: -5px;
right: -5px;
bottom: -5px;
background: linear-gradient(90deg, #44BBFF, #EDD834, #FC575E, #44BBFF);
background-size: 400%;
border-radius: 20px;
}
Дякую всім, я сподіваюся що вам моя стаття хоч чимось допомогла.