Border Animated Button #50

Hover Border 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-50">Button 50</button>
Button CSS
.btn-50 {
    display: inline-block;
    padding: 13px 20px;
    font-family: "Lucida Grande", "Helvetica", sans-serif;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    border: none;
    border-radius: 4px;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    user-select: none;
    /*** full width block ***/
    /* width: 100%; */
}

.btn-50 {
    position: relative;
    border-radius: 26px;
    color: #000;
    border: none;
    overflow: hidden;
    z-index: 1;
}

.btn-50::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background-color: #ededed;
    background-clip: padding-box;
    border: 2px solid transparent;
    border-radius: 26px;
    z-index: -1;
    transition: border-color 0.2s;
}

.btn-50::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background-color: #ff0000;
    border-radius: 26px;
    z-index: -2;
    transform: translate(-150%, -150%);
    transform-origin: left top;
    transition: transform 0.2s;
}

.btn-50:hover::after {
    transform: translate(0, 0);
}

.btn-50:active {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.24);
}

@keyframes rotate50 {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

.btn-50:disabled {
    pointer-events: none;
    opacity: .65;
    color: #7e7e7e;
    box-shadow: none;
    background: #dcdcdc;
}