:root{ --white: #fff; --color: #6D214F; } .demo{ background: #e8e8e8; } .link{ color:var(--white); background: var(--color); font-family: "Lexend Deca", sans-serif; font-size: 22px; font-weight: 600; padding: 4px 10px; text-transform: capitalize; display: inline-block; border: none; position: relative; overflow: hidden; transition: all 0.3s ease 0s; z-index: 1; } .link:hover, .link:focus{ color: var(--white); background: var(--color); } .link:before, .link:after{ content: ""; position: absolute; height: 100%; } .link:before{ background: rgba(255, 255, 255, 0.2); width: 100%; transform: skewX(-30deg); top: 0; left: -100%; transition: all 1s ease-in-out; } .link:after{ background: rgba(255, 255, 255, 0.5); top: 0; left: 0; width: 0%; transition: all 0.5s ease-in-out; } .link:hover:before{ left: 100%; } .link:hover:after{ width: 100%; } @media only screen and (max-width: 767px){ .link{ margin-bottom: 30px; } }