JSFiddle - React, Tailwind, and code Playground

by David Sch

HTML

HTML SCSSResult
EDIT ON
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Create button hover</title>
    
</head>
<body>
  <h3>
    Creative buttons, showing icon on mouse over 
  </h3>
<div>
    <button class="btn-1">Hover over me</button>
</div>

<div>
    <button class="login-btn">Login</button>
</div>

<div>
    <button class="logout-btn">Logout</button>
</div>
</body>
</html>


Resources1×0.5×0.25×Rerun

CSS

.btn-1 {
    font-family: Hack, monospace;
    background: #0F0F6D;
    color: #ffffff;
    cursor: pointer;
    font-size: 2em;
    padding: 1.5rem;
    border: 0;
    transition: all 0.5s;
    border-radius: 10px;
    width: auto;
    position: relative;

    &::after {
        content: "\f054";
        font-family: "Font Awesome 5 Pro";
        font-weight: 400;
        position: absolute;
        left: 85%;
        top: 31%;
        right: 5%;
        bottom: 0;
        opacity: 0;

    }

    &:hover {
        background: #2b2bff;
        transition: all 0.5s;
        border-radius: 10px;
        box-shadow: 0px 6px 15px #0000ff61;
        padding: 1.5rem 3.5rem 1.5rem 1.5rem;

        &::after {
            opacity: 1;
            transition: all 0.5s;

        }
    }


}