Hover Background And Icon Animated Button #154

CSS Hover background and icon moving right side 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-154">
  <span>Button 154</span>
  <svg xmlns="http://www.w3.org/2000/svg" fill="currentcolor" viewBox="0 0 24 24">
    <path d="M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"></path>
  </svg>
</button>
Button CSS
.btn-154 {
    --bg_color: #fd3d3d;
    position: relative;
    transition: all .5s;
    border: none;
    background: 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: 0;
    color: #fff;
    z-index: 1;
}

.btn-154 span {
    display: flex;
    align-items: center;
    letter-spacing: 2px;
    font-weight: bold;
    background: var(--bg_color);
    border-radius: 2rem;
    padding: 15px 15px;
    text-transform: uppercase;
    font-size: 14px;
}

.btn-154::before {
    content: '';
    z-index: -1;
    background-color: var(--bg_color);
    border: 2px solid white;
    border-radius: 2rem;
    width: 110%;
    height: 100%;
    position: absolute;
    transition: .5s;
    opacity: 0.2;
    box-sizing: content-box;
}

.btn-154:hover::before {
    transform: rotate(0deg);
    opacity: 1;
}

.btn-154 svg {
    transform: translateX(-200%);
    transition: .5s;
    width: 0;
    opacity: 0;
}

.btn-154:hover svg {
    width: 25px;
    transform: translateX(0%);
    opacity: 1;
}

.btn-154:active {
    filter: brightness(1.4);
}

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

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