.link{ color: #339f0f; font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 500; line-height: 20px; text-transform: capitalize; display: inline-block; position: relative; z-index: 1; transition: all 0.3s ease 0s; } .link:focus, .link:hover{ color: #00c110; } .link:before, .link:after{ content: ''; background-color: #339f0f; height: 100%; width: 50%; opacity: 0.2; transform: scaleX(0); transform-origin: right center; position: absolute; left: 0; top: 0; z-index: -1; clip-path: polygon(100% 0, 100% 100%, 0 50%); transition: all 0.5s ease 0s; } .link:after{ transform-origin: left center; left: auto; right: 0; clip-path: polygon(0 0, 0% 100%, 100% 50%); } .link:hover:before, .link:hover:after{ transform: scaleX(1); } @media only screen and (max-width: 767px){ .link{ margin-bottom: 30px; } }