CSS Button Generator — Styled Buttons with Hover and Focus States

Design a button that looks great in every state. Start from a preset — solid, outline, ghost, pill, gradient, 3D, glass or neo-brutalist — then tune the colors, padding, corner radius, border and shadow, and the hover, active and focus effects. Try it live in the preview and copy clean, accessible CSS and HTML.

Runs in your browserUpdated

Hover, click and Tab to the button to see each state.

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the CSS Button Generator

  1. Start from a preset: solid, outline, ghost, pill, gradient, 3D, glass or neo-brutalist.
  2. Change the colors (or a gradient), font size, padding, corner radius, border and shadow.
  3. Pick a hover effect and try every state in the preview — hover, press, and Tab for the focus ring.
  4. Copy the CSS and the HTML; rename the .btn class if you like.

Every state, accessible by default

  • Hover gives a clear visual response with a short transition.
  • Active (pressed) moves the button down slightly, so clicks feel physical.
  • Focus-visible shows a strong outline only for keyboard users, so the button stays clean for mouse users but is never invisible to people who navigate with Tab.
  • prefers-reduced-motion turns the movement off for visitors who ask for less animation.

Check the text against the button color with the Contrast Checker — WCAG asks for at least 4.5:1 for normal text. Use a real <button> for actions and an <a> for navigation; the CSS works on both. Related: Box Shadow Generator, CSS Gradient Generator, CSS Hover Animation Generator.

Also searched as: button generator, css button styles, button hover effect css, gradient button css, css button maker, button css code, webflow button style.

Tools that pair well with the CSS Button Generator

  • Border Radius Generator — Round the corners of any box: drag one slider for all corners or set each corner separately, switch to elliptical corners for blob and leaf shapes, and copy the shortest valid border-radius CSS.
  • Glassmorphism Generator — Design a frosted-glass card with live sliders and copy cross-browser CSS — with the -webkit-backdrop-filter prefix and a fallback for older browsers.
  • CSS Animation Generator — Design CSS animations on a real keyframe timeline.
  • CSS Keyframes Generator — A visual editor for @keyframes.

Frequently asked questions

How do I make a button hover effect in CSS?
Add a :hover rule that changes the background, shadow or position, and a transition on the button so the change animates. Pick a hover effect here to get the code.
Should I remove the focus outline on buttons?
No — keyboard users need it. Use :focus-visible, as this generator does, so the ring appears for keyboard navigation but not after mouse clicks.
How do I make a gradient button?
Tick Gradient background and choose two colors; the CSS uses linear-gradient as the background-image.
Does it work in Webflow?
Yes — paste the CSS into an Embed with a style tag (or your site’s custom code) and give your Webflow button the class btn, or copy the values into the Style panel.
Can I install CSS Button Generator as a web app and use it offline?
Yes. CSS Button Generator is an installable web app (PWA) — installed from your browser, not downloaded from an app store. Click Install app at the top of this page in Chrome or Edge (Windows, macOS, Linux, ChromeOS) or on Android, use Share → Add to Home Screen on iPhone and iPad, or File → Add to Dock in Safari 17+ on a Mac. It then opens in its own window with its own icon, and because it runs entirely in your browser it keeps working offline. Firefox on desktop can’t install web apps. How installing works.

Related tools