Border Animated Button #52

CSS Hover 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 style

Disabled style

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 HTML
<button class="btn-52">
     <svg width="150" height="50">
         <defs>
             <linearGradient id="svg52">
                 <stop offset="0%" stop-color="#4CAF50"></stop>
                 <stop offset="100%" stop-color="#FF9800"></stop>
             </linearGradient>
         </defs>
         <rect x="3" y="3" rx="0" fill="none" stroke="url(#svg52)" width="145" height="45"></rect>
     </svg>
     <span>Button 52</span>
</button>
Button CSS
.btn-52 {
    position: relative;
    display: inline-block;
    width: 150px;
    height: 50px;
    font-size: 16px;
    text-align: center;
    text-transform: uppercase;
    background-color: transparent;
    cursor: pointer;
    text-decoration: none;
    font-weight: 900;
    font-family: Arial, Helvetica, sans-serif;
    user-select: none;
    border: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.btn-52 svg {
    position: absolute;
    top: 0;
    left: 0;
}

.btn-52 svg rect {
    stroke-width: 2;
    stroke-dasharray: 353, 0;
    stroke-dashoffset: 0;
    transition: all 600ms ease;
}

.btn-52 span {
    background: linear-gradient(to right, #4CAF50 0%, #FF9800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-52:hover svg rect {
    stroke-dasharray: 74, 336;
    stroke-dashoffset: 186;
}
.btn-52:disabled {
    pointer-events: none;
    opacity: .5;
    color: #939393;
    box-shadow: none;
    background: none;
}
.btn-52:disabled span {
    -webkit-text-fill-color: #939393;
}