:root{ --white: #fff; --main-color: #4aae03; } .btn{ color: var(--white); background: var(--main-color); font-family: "Raleway", sans-serif; font-size: 22px; font-weight: 700; text-transform: capitalize; padding: 4px 12px; border-radius: 30px 30px; border: none; position: relative; overflow: hidden; margin: 0 10px; transition: all 0.3s ease-in-out; z-index: 1; } .btn:hover{ color: var(--main-color); box-shadow: 0 0 8px rgba(0,0,0,0.5); } .btn:before{ content: ""; background: var(--white); transform: skewX(-45deg) scale(0, 1); position: absolute; top: 0; left: -20%; bottom: 0; right: -20%; transition: all 0.5s; z-index: -1; } .btn:hover:before{ transform: skewX(-45deg) scale(1, 1); } @media only screen and (max-width: 767px){ .btn{ margin-bottom: 30px; } }