Hover Background Animated Button #149

CSS hover background rotate 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-149">
    <span>Button 149</span>
</button>
Button CSS
.btn-149 {
    --border_radius: 10px;
    --border_size: 4px;
    --bg_color: #dddedf;
    position: relative;
    width: 120px;
    height: 40px;
    color: #000000;
    border: none;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
    box-sizing: border-box;
    z-index: 1;
    background: none;
    /*** full width block ***/
    /* width: 100%; */
}

.btn-149 span {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 11;
    background: var(--bg_color);
    border-radius: var(--border_radius);
}

.btn-149::before {
    content: '';
    position: absolute;
    inset: 0;
    left: calc(var(--border_size) * -1);
    top: calc(var(--border_size) * -1);
    width: calc(100% + var(--border_size)* 2);
    height: calc(100% + var(--border_size)* 2);
    border-radius: calc(var(--border_radius) + 3px);
    background: linear-gradient(45deg, #338af9, #2ff8ff);
    z-index: -1;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-149::after {
    content: "";
    z-index: -1;
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, #338af9, #2ff8ff);
    transform: translate3d(0, 0, 0) scale(0.95);
    filter: blur(20px);
}

.btn-149:hover::after {
    filter: blur(30px);
}

.btn-149:hover::before {
    transform: rotate(-180deg);
}

.btn-149:active::before {
    scale: 0.7;
}

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

.btn-149:disabled::before {
    animation: none;
    background: #a7a7a7;
}

.btn-149:disabled::after {
    animation: none;
    background: #a7a7a7;
}