Border Animated Button #18
Border animated 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
<button class="btn-18 btn-18-colors">
<span></span>
<span></span>
<span></span>
<span></span>
Button 18
</button>
.btn-18 {
padding: 12px 20px;
display: inline-block;
transform: translate(0%, 0%);
font-size: 14px;
letter-spacing: 1.2px;
user-select: none;
text-align: center;
text-decoration: none;
box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.5);
border: solid 1px;
overflow: hidden;
cursor: pointer;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
/*** full width block ***/
/* width: 100%; */
}
.btn-18-colors {
color: #ffffff;
background-color: #155ed8;
border-color: transparent;
}
.btn-18:hover {
background-color: #0b1b3d;
color: #fff;
}
.btn-18:active {
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.24);
}
.btn-18:disabled {
pointer-events: none;
opacity: .65;
color: #939393;
box-shadow: none;
background-color: #d0d0d0;
}
.btn-18 span {
position: absolute;
--border-color-a-18: rgba(242, 250, 0, 0.2);
--border-color-b-18: #ffeb00;
}
.btn-18 span:nth-child(1) {
top: 0px;
left: 0px;
width: 100%;
height: 2px;
background: linear-gradient(to left, var(--border-color-a-18), var(--border-color-b-18));
animation: 2s anm-18-Top linear infinite;
}
@keyframes anm-18-Top {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
}
.btn-18 span:nth-child(2) {
top: 0px;
right: 0px;
height: 100%;
width: 2px;
background: linear-gradient(to top, var(--border-color-a-18), var(--border-color-b-18));
animation: 2s anm-18-Right linear -1s infinite;
}
@keyframes anm-18-Right {
0% {
transform: translateY(100%);
}
100% {
transform: translateY(-100%);
}
}
.btn-18 span:nth-child(3) {
bottom: 0px;
left: 0px;
width: 100%;
height: 2px;
background: linear-gradient(to right, var(--border-color-a-18), var(--border-color-b-18));
animation: 2s anm-18-Bottom linear infinite;
}
@keyframes anm-18-Bottom {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(100%);
}
}
.btn-18 span:nth-child(4) {
top: 0px;
left: 0px;
height: 100%;
width: 2px;
background: linear-gradient(to bottom, var(--border-color-a-18), var(--border-color-b-18));
animation: 2s anm-18-Left linear -1s infinite;
}
@keyframes anm-18-Left {
0% {
transform: translateY(-100%);
}
100% {
transform: translateY(100%);
}
}
.btn-18:disabled span {
animation: none;
display: none;
}