Hover Background Sliding Animate Button #190

CSS Hover Background multiple sliding animate 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

Preview Multiple Animations

This CSS button code includes multiple animations. Modify the code below to adjust the animation style as desired and remove the remaining lines of code. Modify the animation direction code provided below --animate_direction: var(--left_to_right_bottom);

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-190">Button 190</button>
Button CSS
.btn-190 {
    /*** animation directions ***/
    --left_to_right_bottom: translateY(-100%) translateX(-100%);
    --right_to_left_bottom: translateY(-100%) translateX(100%);
    --left_to_right_top: translateY(100%) translateX(-100%);
    --right_to_left_top: translateY(100%) translateX(100%);
    --right_to_left: translateY(0%) translateX(100%);
    --left_to_right: translateY(0%) translateX(-100%);
    --bottom_to_top: translateY(100%) translateX(0%);
    --top_to_bottom: translateY(-100%) translateX(0%);
}

.btn-190 {
    /*** change direction ***/
    --animate_direction: var(--left_to_right_bottom);
    --color: #000;
    --slide_bg_color: #006eff;
    border: 2px solid #006eff;
    padding: 10px 12px;
    background-color: transparent;
    color: var(--color);
    font-size: 15px;
    z-index: 1;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    font-family: Arial, Helvetica, sans-serif;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: color 0.3s;
    /*** full width block ***/
    /* width: 100%; */
}

.btn-190::before {
    content: "";
    z-index: -1;
    transform: var(--animate_direction);
    transition: all 0.3s;
    background: var(--slide_bg_color);
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    position: absolute;
}

.btn-190:hover::before {
    transform: translateY(0) translateX(0);
}

.btn-190:hover {
    color: #fff;
}

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

/*** dark mode ***/
html.dark-mode .btn-190 {
    --color: #ffffff;
}