.link{ color: #1b1b20; font-family: 'Dancing Script', cursive; font-size: 25px; font-weight: 700; line-height: 20px; text-transform: capitalize; letter-spacing: 1px; display: inline-block; position: relative; z-index: 1; transition: all 0.5s; } .link:focus, .link:hover{ color: #fff; } .link:after{ content: ''; background: #8743b5; border-radius: 20px/50px; transform: scale(0); position: absolute; opacity: 0; z-index: -1; transition: all 0.3s ease 0s; } .link:hover:after{ opacity: 1; left: -5px; right: -5px; top: -6px; bottom: -4px; transform: scale(1) ; } @media only screen and (max-width: 767px){ .link{ margin-bottom: 30px; } }