Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Build a complete button style -- background, padding, radius, hover state.
.btn {
background-color: #1565C0;
color: #FFFFFF;
padding: 12px 24px;
border-radius: 8px;
border: none;
cursor: pointer;
transition: background-color 0.2s ease;
}
.btn:hover {
background-color: #0D47A1;
}This tool builds a complete, ready-to-use button style block -- background color, text color, padding, border-radius, and a hover-state background transition -- with a live preview button you can click-test the hover effect on.
Choose background, text, and hover-background colors, plus padding and border-radius. The preview button and generated CSS update instantly.
For other CSS visual generators, see the CSS Gradient Generator or Box Shadow Generator to add further depth to your button.
The tool produces two rules. The first is .btn with your background color, text color, padding, border radius, plus fixed lines: border: none; cursor: pointer; and transition: background-color 0.2s ease; The second is .btn:hover with your hover background color. The starting values are a blue background (#1565C0), white text, a darker blue hover (#0D47A1), padding of 12 pixels vertically and 24 pixels horizontally, and an 8 pixel radius. Padding is written vertical first, then horizontal, as padding: 12px 24px; Note that the two padding fields are labelled X and Y in the tool but appear in the CSS in the opposite order, which is simply how the shorthand works.
Suppose a hypothetical design system needs a secondary button that is calm rather than loud. Choose a light background such as a pale gray, a dark text color, a slightly darker gray for hover, padding of 10 vertical and 20 horizontal, and a border radius of 999 so it becomes a pill. Copy the CSS and, if this is your only button style, keep the class name .btn. If you have several variants, rename the class in the output, for instance .btn-secondary, and keep the fixed base rules in a shared class.
Add class="btn" to a button or an anchor element. For links styled as buttons, remember that anchors have underlines and inline display by default, so you may need text-decoration: none and display: inline-block. The generated border: none also removes any default border of a button element. If your design needs an outline button, edit the border line and set the background to transparent.
Padding sets how large the clickable area is. Very small values make buttons hard to tap on a phone, so leave enough vertical and horizontal padding for a comfortable target. Confirm the total height with your font size, since a button's height is text height plus twice the vertical padding.
The tool provides one hover transition on the background color only. It does not generate a pressed state, a shadow, a gradient background or icon spacing. Combine it with other generators for those extras.
The generated CSS includes transition: background-color 0.2s ease; so the color change animates smoothly on hover instead of switching instantly, which reads as more polished.
No -- this generates the CSS class (.btn) only; apply it to your own <button> or <a> element by adding the class name.
Yes -- combine the generated CSS with the Box Shadow Generator's output for a more layered button design.
Yes. Change the class name in both rules of the output, the base rule and the hover rule, and use the same name in your HTML.
The base rule includes a background-color transition of 0.2 seconds. Adjust the number in the pasted code to make it faster or slower.
Write an extra rule such as .btn:focus-visible with an outline. The generator does not include one, but accessible buttons should have one.
Yes, with the class applied to an anchor. You may also want display: inline-block and text-decoration: none so it looks like a button.
Reference: MDN Web Docs