CSS Button Generator

Client-sideNo sign-upFree

Design a button's colors, border, padding, shadow, and hover state, then copy ready-to-use CSS and HTML.

Quick facts

Category
Generators
Best for
Prototyping a button style with a real hover preview before pasting CSS into a stylesheet
Live preview (hover it)
Content & colors
Hover state
Border & padding
Box shadow
CSS
.my-button {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background-color: #7c5cff;
  border: 0px none #000000;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
}

.my-button:hover {
  background-color: #6342f5;
  color: #ffffff;
}
HTML
<button class="my-button">Click me</button>
In-content slot
Was this tool helpful?
On this page

Overview

Build a complete button style - label text, font size and weight, text and background color, border width/style/color/radius, vertical and horizontal padding, and an optional multi-value box-shadow - with a live preview you can actually hover over to see the real hover transition, not just a static mockup. Hover styling (background and text color) is optional and only appears in the generated CSS when you've actually customized it, keeping the output minimal rather than padding it with an identical, pointless `:hover` block. Copy the CSS and the matching HTML snippet separately, since you'll often want to drop the HTML into a template while keeping the CSS in a stylesheet. Runs entirely client-side.

Best for: Prototyping a button style with a real hover preview before pasting CSS into a stylesheet

How to use this tool

  1. Set label, colors, and sizing. Font size/weight, text and background color, padding.
  2. Add border, radius, and shadow. All optional, each with its own controls.
  3. Customize the hover state. Hover over the live preview to see it - only appears in the CSS output if changed from the base state.
  4. Copy CSS and HTML separately. Two separate copy buttons for the two separate things you'll paste.

Frequently asked questions

Yes - hovering the preview button triggers the same hover color change the generated CSS `:hover` block will produce, using the component's own hover state rather than requiring a click.

No - the `:hover` block only appears when the hover background or hover text color is actually different from the base state, so the output stays minimal instead of including a no-op hover rule.

Explore more free tools

Formatters, converters, validators, and generators - all free and running entirely in your browser.

Browse more tools