Skip to content

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.

It works in your browser. We do not store or send anything you type.Free · No sign-up required

Workspace · CSS Button Generator

Runs in your browser · 100% local

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;
}
Files are processed in your browser; if you are signed in with history enabled, text results appear in your history.
Instructions

How to use it

01

Change the text and the background, text and hover colours.

02

Adjust the radius, padding, font size, border and shadow.

03

Check the preview and copy the generated CSS into your stylesheet.

Examples

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.

Reference guide

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

Frequently Asked Questions

Yes, but the preview only displays spot colours. For production, you can replace the values with your own variables.

Related tools

Other tools that can help with similar tasks.

More at Web development→
Online CSS button generator · ByTooly