A worked example, rendered from real sample data. Sign in to run the tool on your own input.
lift.hover-lift {
transition: transform 220ms ease, box-shadow 220ms ease;
will-change: transform;
}
.hover-lift:hover,
.hover-lift:focus-visible {
transform: translateY(-6px);
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}
.hover-lift:focus-visible {
outline: 2px solid #3b82f6;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.hover-lift, .hover-lift::before, .hover-lift::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* HTML: <button class="hover-lift" style="padding:14px 28px;border-radius:12px;border:0;background:#1f2937;color:#fff;font:600 15px system-ui;cursor:pointer">Hover or Tab to me</button> */
Generate CSS hover effects for buttons, cards, and links. Part of the DevTools Surf developer suite. Browse more tools in the Animation / CSS collection.