Border Gradient Color Animated Button #97

CSS hover border gradient color 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

Full width block 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-97">Button 97</button>
Button CSS
.btn-97 {
    --border_size: 3px;
    --bg_color: #000;
    color: #fff;
    border-radius: 13px;
    position: relative;
    padding: 15px 28px;
    border: 0;
    background-color: transparent;
    font-size: 16px;
    font-weight: 500;
    z-index: 2;
    overflow: hidden;
    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;
}

.btn-97::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: conic-gradient(#488cfb, #29dbbc, #ddf505, #ff9f0e, #e440bb, #655adc, #488cfb);
    filter: hue-rotate(0);
    z-index: -2;
    box-sizing: border-box;
}

.btn-97.btn-97::before {
    content: '';
    position: absolute;
    z-index: -1;
    background-color: var(--bg_color);
    inset: var(--border_size);
    border-radius: 10px;
    box-sizing: border-box;
}

.btn-97:hover::after {
    animation: rotate_97 linear 500ms infinite;
}

@keyframes rotate_97 {
    100% {
        filter: hue-rotate(1turn);
    }
}

/*** disabled style ***/
.btn-97:disabled {
    pointer-events: none;
    opacity: .65;
    color: #7e7e7e;
    background: #dcdcdc;
    box-shadow: none;
}

.btn-97:disabled::before {
    --bg_color: #dcdcdc;
}

.btn-97:disabled::after {
    background: #dcdcdc;
}