Hover Change Button Text #172

CSS Hover flip effect and change button. text show hide front back text

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-172">
    <span class="front-text">Button 172</span>
    <span class="back-text">Back </span>
</button>
Button CSS
.btn-172 {
    padding: 15px 25px;
    width: 150px;
    height: 50px;
    text-align: center;
    transform-style: preserve-3d;
    perspective: 1000px;
    transform-origin: center center;
    font-family: Arial, Helvetica, sans-serif;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    border-radius: 30px;
    box-sizing: border-box;
    font-size: 14px;
    color: #fff;
    font-weight: bold;
    /*** full width block ***/
    /* width: 100%; */
}

.btn-172 span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    border-radius: 30px;
    text-transform: uppercase;
    transition: 1s;
    box-sizing: border-box;
}

.btn-172 .front-text {
    transform: rotateX(0deg) translateZ(2px);
    background: #0ab993;
}

.btn-172:hover .front-text {
    transform: rotateX(-180deg) translateZ(2px);
}

.btn-172 .back-text {
    transform: rotateX(180deg) translateZ(2px);
    background: #ff0062;
}

.btn-172:hover .back-text {
    transform: rotateX(0deg) translateZ(2px);
}

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

.btn-172:disabled span {
    color: #7e7e7e;
    background: #dcdcdc;
}