.link{ color: #1a7ec0; font-family: 'Varela Round', sans-serif; font-size: 22px; font-weight: 500; line-height: 20px; text-transform: capitalize; display: inline-block; position: relative; z-index: 1; transition: all 0.5s ease 0s; } .link:focus, .link:hover{ color: #852cc0; } .link:before{ content: ''; background-color: red; width: 100%; height: 1px; position: absolute; bottom: 0; left: 0; z-index: -1; transition: all 0.3s ease-in 0s; } .link:hover:before{ height: 100%; opacity: 0; } @media only screen and (max-width: 767px){ .link{ margin-bottom: 30px; } }