CSS Button Generator
Customise the appearance of a button and get the full CSS, including hover and focus states, without having to write the properties by hand.
Workspace · CSS Button Generator
Vista previa
CSS generado
.btn-custom {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
background-color: #17191c;
color: #ffffff;
border: 0px solid #17191c;
border-radius: 999px;
padding: 14px 24px;
font-size: 15px;
font-weight: 500;
line-height: 1;
text-decoration: none;
cursor: pointer;
width: auto;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
transition: background-color .2s ease, transform .2s ease;
}
.btn-custom:hover {
background-color: #2c2f34;
}
.btn-custom:active {
transform: scale(0.98);
}
.btn-custom:focus-visible {
outline: 2px solid currentColor;
outline-offset: 3px;
}How to use it
Change the text and the background, text and hover colours.
Adjust the radius, padding, font size, border and shadow.
Check the preview and copy the generated CSS into your stylesheet.
Examples
Main button
Dark background, white text, 999 px radius and a soft shadow.
Secondary button
Transparent background, 1-pixel border and the same radius.
Full-width button
Enable full-width mode for forms and mobile devices.
What you need to know
The generated CSS includes `display`, `alignment`, `transition`, `hover`, `active` and `focus-visible`. You can copy it as it is or adapt the class names to suit your project.
Colours are validated before they are applied. If a value is not a recognised CSS colour, the default value is used to ensure the preview remains intact.
Frequently Asked Questions
Related tools
Other tools that can help with similar tasks.
Border-radius generator
Adjust the four corners individually and copy the CSS whilst viewing the preview.
CSS Shadow Generator
Creates soft box shadows and copies the box-shadow property.
CSS Gradient Generator
Design linear or radial gradients and copy the CSS.
