Hover Border Animating Button #192
CSS button border moves in all four directions when hovering
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-192">
Button 192
<span class="bdr-left"></span>
<span class="bdr-top"></span>
<span class="bdr-right"></span>
<span class="bdr-bottom"></span>
</button>
.btn-192 {
--border_color: #060ae4;
--border_thickness: 2px;
--color: #000000;
--bg_color: #f5f5f5;
color: var(--color);
outline: none;
border: none;
font-size: 17px;
padding: 15px 25px;
position: relative;
background: var(--bg_color);
font-family: Arial, Helvetica, sans-serif;
cursor: pointer;
text-decoration: none;
user-select: none;
display: inline-flex;
justify-content: center;
align-items: center;
/*** full width block ***/
/* width: 100%; */
}
.btn-192:active {
transform: scale(.98);
}
.btn-192 span {
position: absolute;
background: var(--border_color);
transition: .5s;
width: var(--border_thickness);
height: var(--border_thickness);
}
.btn-192 .bdr-left {
top: 0;
left: 0;
height: 40%;
}
.btn-192 .bdr-top {
top: 0;
left: 0;
width: 25%;
}
.btn-192 .bdr-right {
bottom: 0;
right: 0;
height: 40%;
}
.btn-192 .bdr-bottom {
bottom: 0;
right: 0;
width: 25%;
}
.btn-192:hover .bdr-left {
height: 100%;
}
.btn-192:hover .bdr-top {
width: 100%;
}
.btn-192:hover .bdr-right {
height: 100%;
}
.btn-192:hover .bdr-bottom {
width: 100%;
}
/*** disabled style ***/
.btn-192:disabled {
pointer-events: none;
opacity: .65;
color: #7e7e7e;
background: #dcdcdc;
box-shadow: none;
text-shadow: none;
}
.btn-192:disabled span {
--border_color: #7e7e7e;
}
/*** dark mode ***/
html.dark-mode .btn-192 {
--border_color: #fffb00;
--color: #ffffff;
--bg_color: #242b2e;
}