About the CSS Button Generator
This tool helps you design a single CSS button in your browser. You set the label, choose background and text colors, pick padding and font size, set corner radius, and pick a style: solid, outline or soft. You can add a shadow and pick hover and keyboard focus styles. The page shows a live preview and generates a simple CSS class you can copy into your stylesheet. The generator runs entirely in your browser; nothing is uploaded or stored on a server. It is aimed at web designers, front-end developers and content editors who need a quick, editable button style. Compared with basic generators, this tool always includes a keyboard focus rule and hover state so you get usable styles faster without extra edits.
How to use it
- 1Enter the button text you want to display
- 2Pick background and text colors with the color pickers
- 3Adjust padding, font size and border radius with sliders or inputs
- 4Choose style (solid, outline, soft) and add a shadow, then set hover and focus behaviors
- 5Copy the generated CSS and paste it into your stylesheet or a style block
Worked example
Inputs: label "Send", background #0066cc, text color #ffffff, padding 12px 20px, font-size 16px, border-radius 6px, style solid, box-shadow 0 2px 6px rgba(0,0,0,0.15). Resulting CSS: .button { display: inline-block; padding: 12px 20px; font-size: 16px; color: #ffffff; background: #0066cc; border: none; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,0.15); cursor: pointer; transition: background-color 150ms ease, transform 150ms ease; } .button:hover { background: #005bb5; } .button:focus-visible { outline: 3px solid rgba(0,102,204,0.25); outline-offset: 3px; }
How it works
Designs a CSS button: text, colours, padding, font size, radius, solid, outline or soft style and shadow, with hover and keyboard focus styles and a live previewWorks in the browser with nothing to installSource: WCAG non-text contrast and contrast formulasFocus visible guidance (use :focus-visible). Last checked 7 November 2026.
What it is good for
- Live preview updates as you change settings
- Includes hover and keyboard focus styles by default
- Runs entirely in your browser; no upload or install
- Does not export Tailwind or React JSX code
- No automatic WCAG contrast pass/fail; check contrast yourself
Questions people ask
How do I add the generated CSS to my site?
Copy the generated .button CSS and paste it into your main stylesheet or inside a <style> block in the page head. Then add class="button" to the HTML element, for example <button class="button">Send</button>.
Does the tool include keyboard focus styles?
Yes. The tool generates a :focus-visible rule so keyboard users see a visible outline. You should test with keyboard navigation to confirm the visual contrast and placement meet your needs.
Will the tool check color contrast for accessibility?
No. The generator does not automatically pass or fail WCAG contrast ratios. You can use the W3C contrast formula or a contrast checker to verify ratios meet WCAG 2.1 AA (4.5:1 for normal text).
Does this tool respect reduced motion preferences?
The generator uses short transitions by default. You should add a prefers-reduced-motion media query manually if you need to fully respect user motion preferences.
Can I export the button as a component for React or Tailwind?
Not directly. This tool produces plain CSS. You can convert the class rules into a React component or a Tailwind-compatible set of utilities yourself.
Where does my data go when I use this tool?
Everything runs in your browser. No files are uploaded to a server by the tool, so your inputs remain local unless you copy or save them yourself.
Help keep every tool free
FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.