Hover Background Slide Out Animated Button #127

CSS Hover Background slide out 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-127">
  <span>Button 127</span>
</button>
Button CSS
.btn-127 {
    position: relative;
    border-radius: 5px;
    background: #d01f91;
    box-shadow: 0px 6px 24px 0px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: none;
    font-family: Arial, Helvetica, sans-serif;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 13px 25px;
    /*** full width block ***/
    /* width: 100%; */
}

.btn-127:after {
    content: " ";
    width: 0%;
    height: 100%;
    background: #2196f3;
    position: absolute;
    transition: all 0.4s ease-in-out;
    right: auto;
    left: auto;
}

.btn-127:hover::after {
    right: auto;
    left: auto;
    width: 100%;
}

.btn-127 span {
    text-align: center;
    text-decoration: none;
    width: 100%;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    z-index: 20;
    transition: all 0.3s ease-in-out;
}

.btn-127:hover span {
    color: #fff;
    animation: move_127 0.3s ease-in-out;
}

@keyframes move_127 {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

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

.btn-127:disabled span {
    color: #7e7e7e;
}