Animated Border Button #184
CSS snake-like border animation button
Adding these style CSS buttons to your website is easier than you think. Simply copy and paste the CSS code provided with each button design into your stylesheet
Preview Button Style
You can view the default style of buttons, the disabled state mode style of buttons, and the full-width block style of the button here. Some buttons style may not display in full width format
Button Source Code HTML and CSS
Click the button below to download the source code or edit it live.
To copy this click on the icon at the top right of the code box
.btn-184 {
--color: #000000;
--boder_color: linear-gradient(240deg, #3bb1ff 50%, #f70505 50%);
--bg_color: #f3f3f3;
--border_radius: 10px;
--width: 140px;
--border_thikness: 2px;
position: relative;
z-index: 1;
width: var(--width);
height: 50px;
color: var(--color);
font-size: 15px;
border-radius: var(--border_radius);
overflow: hidden;
transition: .3s;
border: none;
background: none;
font-family: Arial, Helvetica, sans-serif;
cursor: pointer;
text-decoration: none;
user-select: none;
display: inline-flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
font-weight: bold;
/*** full width block ***/
/* width: 100%; */
}
.btn-184::before {
content: '';
position: absolute;
z-index: -2;
left: 50%;
top: 50%;
width: var(--width);
height: var(--width);
background: var(--boder_color);
transform-origin: left top;
animation: rotate 2s linear infinite;
box-sizing: border-box;
}
.btn-184::after {
content: '';
position: absolute;
z-index: -1;
inset: var(--border_thikness);
background: var(--bg_color);
border-radius: calc(var(--border_radius) - 2px);
box-sizing: border-box;
}
.btn-184:hover {
--color: #686868;
--boder_color: #000000;
}
@keyframes rotate {
100% {
/*** move right side 360deg, left -360deg ***/
transform: rotate(-360deg);
}
}
/*** disabled style ***/
.btn-184:disabled {
pointer-events: none;
opacity: .65;
color: #7e7e7e;
background: #dcdcdc;
box-shadow: none;
text-shadow: none;
}
.btn-184:disabled::before {
animation: none;
--boder_color: #a8a7a7;
}
/*** dark mode style ***/
html.dark-mode .btn-184 {
--color: #ffffff;
--bg_color: #1b2022;
--boder_color: #f7e705;
}