Background Animated Button #17

CSS Background animated dark color 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-17">Button 17</button>
Button CSS
.btn-17 {
    --color: #fff;
    --bg_color: #212529;
    --border_color: transparent;
    color: var(--color);
    background: var(--bg_color);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border_color);
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    padding: 12px 20px;
    font-size: 14px;
    overflow: hidden;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 1.2px;
    user-select: none;
    font-weight: bold;
    /*** full width block ***/
    /* width: 100%; */
}

.btn-17:after,
.btn-17:before {
    content: "";
    animation: anm-17 0.8s linear infinite;
}

.btn-17:hover {
    --color: #fff;
    --bg_color: #f00;
}

.btn-17:active {
    --color: #fff;
    --bg_color: #0066ff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.24);
}

@keyframes anm-17 {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1),
            0 0 0 20px rgba(255, 255, 255, 0.1),
            0 0 0 40px rgba(255, 255, 255, 0.1),
            0 0 0 60px rgba(255, 255, 255, 0.1);
    }

    100% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0.1),
            0 0 0 40px rgba(255, 255, 255, 0.1),
            0 0 0 60px rgba(255, 255, 255, 0.1),
            0 0 0 80px rgba(255, 255, 255, 0);
    }
}

/*** disabled style ***/
.btn-17:disabled {
    pointer-events: none;
    opacity: .65;
    color: #0f0f0f;
    box-shadow: none;
    text-shadow: none;
    background: #dcdcdc;
}

.btn-17:disabled:after,
.btn-17:disabled:before {
    animation: none;
}