CSS Button Generator With Hover and Focus States
Design a button and copy the CSS, including the hover, active and focus-visible states.
A button is not finished when it looks right at rest. It needs a hover state, a pressed state, a focus ring that appears for keyboard users but not for mouse clicks, and a disabled state — and the generated CSS includes all of them. Padding is set separately across and down because a button's proportions carry more of its character than its radius does. The focus ring uses :focus-visible rather than :focus, so clicking does not leave an outline behind while tabbing still shows one.
Runs in your browser- Privacy
- Runs entirely in your browser — nothing is uploaded
- Cost
- Free, unlimited, no sign-up
Frequently asked questions
Why :focus-visible instead of :focus?
Do I need a disabled style?
Is a transition on transform expensive?
How to use the css button generator
- 1Choose the style.
- 2Pick the accent.
- 3Pick the label colour.
- 4Set the corner radius.
- 5Set the padding — across.
- 6Set the padding — down.
- 7Set the font size.
- 8Choose the weight.
- 9The result appears immediately — copy or download it.
Embed this tool
Put the working css button generator on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.
Share this tool
Related tools
CSS Hover Effect GeneratorGenerate a hover effect that animates cleanly, with the reduced-motion guard included.CSS Border Radius GeneratorDrag eight handles to shape every corner: elliptical radii, inverted corners and squircles.CSS Box Shadow GeneratorDesign a CSS box-shadow with live values for offset, blur, spread and colour.CSS Scrollbar StylerStyle a scrollbar with both the standard properties and the WebKit pseudo-elements.CSS Shape GeneratorGenerate triangles, arrows, stars and other shapes using pure CSS.CSS Tooltip GeneratorGenerate a tooltip from a data attribute — no JavaScript, no extra markup.
Last updated
More css generators