.link{ color: #13aa52; font-family: 'Slabo 27px', serif; font-size: 24px; line-height: 20px; text-transform: capitalize; display: inline-block; transition: all 0.3s ease 0s; } .link:focus, .link:hover{ color: #087c39; animation: animate .4s linear 1; } @keyframes animate{ 30% { transform: translate3d(0, -5px, 0) rotate(5deg); } 50% { transform: translate3d(0, -3px, 0) rotate(-4deg); } 80% { transform: translate3d(0, 0, 0) rotate(-3deg); } 100% { transform: rotate(0deg); } } @media only screen and (max-width: 767px){ .link{ margin-bottom: 30px; } }