Home/Tools/Animations/Hover Effects Generator
Animations · Generator

Hover Effects Generator

Create stunning hover effects for buttons, cards, and images.

Hover Effect

Settings

300ms
1

Preview (Hover the button)

Generated CSS
.element {
  transition: all 300ms ease;
}

.element:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}
100%
Free, no
sign-up needed
0
Code written
by hand
85+
CSS tools
in one place
<1s
Copy-ready
CSS instantly
What is this

What is the CSS Hover Effects Generator?

Generate CSS hover effect code for buttons, cards, and links. Choose from lift, glow, underline, colour shift, and more - with live preview.

Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.

How to use

Using the CSS Hover Effects Generator

Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.

1

Select an effect type

Choose lift, glow, underline, fill, scale up, scale down, shine, or border highlight. The preview shows the effect on a sample element.

2

Adjust intensity and timing

Set the translation distance, shadow spread, or colour opacity. Adjust the transition duration and easing.

3

Copy the CSS

Click Copy to get both the base state and the :hover state rules together.

The output

What the generated code looks like

Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.

styles.css
/* Lift and shadow effect */
.card {
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* Colour fill on link */
.nav-link {
  position: relative;
  color: #6C2EF5;
  text-decoration: none;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: currentColor;
  transition: width 250ms ease;
}
.nav-link:hover::after { width: 100%; }

Use :focus-visible alongside :hover for keyboard accessibility. Hover effects should also apply on focus for users who navigate with keyboards.

Copy & paste

Ready-to-use CSS patterns

Drop any of these straight into your project — no modifications needed.

Hover only where hover exists

Touch screens fire :hover on tap and can leave a card "stuck" lifted. Wrap the effect in a hover media query and mirror it on keyboard focus.

styles.css
.card { transition: transform 200ms ease, box-shadow 200ms ease; }

@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgb(0 0 0 / .12); }
}
.card:focus-visible { outline: 2px solid #1B4DFF; outline-offset: 4px; }

Image zoom inside a fixed frame

Scale the image, not the card, and clip the overflow so the layout around it never moves.

styles.css
.thumb { overflow: hidden; border-radius: 16px; }
.thumb img { transition: transform 400ms ease; display: block; width: 100%; }
.thumb:hover img { transform: scale(1.06); }
Common mistakes & fixes

Common mistakes & how to fix them

A few habits trip people up. Here is what to watch for — and the exact fix.

Animating box-shadow on many cards

Transitioning a large box-shadow repaints on every frame and can stutter on long grids.

Fix: Put the larger shadow on a ::after pseudo-element and transition its opacity instead.

Using transition: all

transition: all also animates colour, width and layout properties you did not intend, and costs performance.

Fix: List the properties: transition: transform 200ms ease, box-shadow 200ms ease.

Hover-only affordances

Information that only appears on hover (an edit button, a caption) is unreachable on touch devices.

Fix: Show essential controls by default and use hover only to enhance them.

Pro tips

Pro tips for better results

★

Add :focus-visible for every hover effect

Keyboard users navigate with Tab and need focus styles as strong as hover styles. Apply the same visual treatment to :focus-visible that you apply to :hover.

★

translateY(-4px) is the standard card lift

A 2-4px upward movement on hover combined with a slightly larger box-shadow creates a convincing lift effect. More than 6px looks exaggerated.

★

Use currentColor for hover effects tied to the text colour

currentColor inherits from the element colour property. Using it in pseudo-element backgrounds or borders means the effect automatically adapts to different link colours.

FAQ

Frequently asked questions

transform and opacity are composited by the GPU and stay smooth even on low-end phones. Colour and background-color are cheap too. Avoid animating width, height, margin or top, which force the browser to recalculate layout on every frame.
Wrap movement-based effects in @media (prefers-reduced-motion: no-preference) { … } or set transition: none inside @media (prefers-reduced-motion: reduce). Colour changes can usually stay.
On touch devices, :hover is triggered on tap rather than pointer hover. This can cause effects to appear stuck in the hovered state after tapping. Use @media (hover: hover) to limit hover effects to devices with true pointer hover support.
No. Everything runs in your browser. Nothing is sent to a server.

From the blog

Read more →