:root{ --color: #6D214F; --white: #fff; } .btn{ color: var(--color); font-family: 'Raleway', sans-serif; font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; padding: 8px 15px; border-radius: 5px; border: 1px solid var(--color); overflow: hidden; position: relative; z-index: 1; transition: all 0.35s; } .btn:hover, .btn:focus{ color: var(--white); background: var(--color); } .btn:before{ content: ""; background: var(--color); width: 12px; height: 1px; transform: translateX(0%) translateY(-50%); position: absolute; top: 50%; left: 0; transition: all 0.2s; transition-delay: 0.1s; } .btn:hover:before{ background: var(--white); left: 100%; transform: translateX(-100%) translateY(-50%); } @media only screen and (max-width: 767px){ .btn{ margin-bottom: 30px; } }