:root{ --background: linear-gradient( 109.6deg, rgba(61,131,97,1) 11.2%, rgba(28,103,88,1) 91.1% ); } .demo{ background: var(--background); } .link{ color: #fff; font-family: 'Dosis', sans-serif; font-size: 24px; font-weight: 600; line-height: 24px; text-transform: capitalize; display: inline-block; position: relative; z-index: 1; transition: all 0.5s; } .link:focus, .link:hover{ color: #1c6758; } .link:before, .link:after{ content: ""; position: absolute; width: 100%; left: 0; } .link:before{ background: #FCF7F9; height: 100%; box-shadow: 0 0 0 3px #FCF7F9; transform-origin: 100% 50%; transform: scale(0, 1); top: 0; z-index: -1; transition: transform 0.3s cubic-bezier(0.33, 0.91, 0.42, 1) 0.1s; } .link:after{ background: rgba(255, 255, 255, 0.3); height: 2px; transform-origin: 0% 50%; bottom: 0; transition: transform 0.3s cubic-bezier(0.33, 0.91, 0.42, 1) 0.1s; } .link:hover:before{ transform: scale(1); transform-origin: 0 50%; } .link:hover:after{ transform: scale(0, 1); transform-origin: 100% 50%; } @media only screen and (max-width: 767px){ .link{ margin-bottom: 30px; } }