Skip to content

CSS Button Generator with Hover Effects

Design a custom CSS button: colors, font, padding, border radius, border, shadow, hover color and lift effect, with ready-made presets and copy-ready HTML and CSS including focus styles.

Hover and click the button to see its hover and active states.

Presets

Code

How to design a button

  1. Choose a preset (Primary, Pill, Outline, Soft, Brutalist or Dark) or start from scratch.
  2. Set the colors, font size, weight, padding, radius, border and shadow.
  3. Use Hover: darken to make the hover color darker (positive values) or lighter (negative values), and switch on Lift on hover for a small upward move.
  4. Hover and click the preview, then copy the CSS and the HTML.

What the generated CSS includes

  • An inline-flex base, so an icon and the label line up and stay centered.
  • :hover and :active states with a short transition.
  • A visible :focus-visible outline for keyboard users. Never remove focus styles without a replacement.

Button design best practices

  • Make touch targets at least 44 by 44 pixels: about 12px vertical padding with a 16px font.
  • Text must contrast with the background at 4.5:1 or more; check your colors with the contrast checker.
  • Use one solid primary button per view, and outline or soft styles for secondary actions.
  • Use a <button> for actions and an <a> for navigation, even if they look the same.
  • Keep labels short and specific: “Create account” is clearer than “Submit”.

Fine-tune shadows with the box shadow generator, or browse ready-made button styles for Bootstrap, Tailwind CSS and pure CSS.

More CSS tools