Motion Library ‹ Free tools

All / Hover

Underline that draws in

A link underline grows from the left on hover and exits to the right, using a scaled pseudo-element.

CSSBeginner
Live demo Open full screen

Good for

Navigation links, footers and inline text links.

Watch out for

Changing transform-origin on hover-out is what makes it exit on the opposite side. Keep a visible focus style too.

Accessibility

Wrap motion in @media (prefers-reduced-motion: reduce) and switch it off or shorten it for people who ask for less movement.