CSS Button Generator
Design a button with colours or a gradient, padding, font, corners, border and shadow, plus hover, press and focus states. Try it live and copy CSS, HTML and Tailwind.
Free, no sign-up
Your data stays on your device
Works offline after first open
The tool
Loading the tool…
How to use
- Pick a preset or start from scratch, and type the button label.
- Adjust colours, padding, font, corners, border and shadow, and choose a hover effect. Hover and press the button to try it.
- Copy the CSS and HTML, or the Tailwind classes.
Privacy & how it works
Processes your data in the browser and stores nothing.
- Engine: lightweight in-page code, no external libraries.
- Works offline after you open it once.
Frequently asked questions
Why is there a :focus-visible rule?
So keyboard users can see where they are. Keep it; it only shows for keyboard focus, not mouse clicks.
What does the contrast warning mean?
We compute the WCAG contrast ratio between the text and button colours. Below 4.5 the text may be hard for some people to read. With a gradient we check the weaker colour.
Does the code work on any site?
Yes, plain CSS with no libraries. Rename the .btn class if you like and put your own label inside the button.
Related tools
Neo-Brutalism GeneratorDesign neo-brutalist buttons and cards: bold colours, thick borders and hard shadows, with a press or lift effect on hover. Copy CSS with every state, or Tailwind classes.Box Shadow GeneratorDesign multi-layer box-shadow: offset, blur, spread, colour with opacity and inset, plus a one-tap smooth layered shadow. Copy ready CSS or Tailwind code.Gradient GeneratorDesign linear, radial or conic gradients with draggable colour stops, copy ready CSS and Tailwind code, or download a PNG at any size.Border Radius GeneratorControl element corner rounding: one value, each corner separately, or 8 elliptical values for organic shapes like eggs and drops. The code is shortened automatically.