Favorite places of your favorite city
Home
Add to preferred sources on Google

CSS Button Generator

Create a text-labelled button with reusable HTML and CSS. Edit its shape and state colors, inspect a live native control or a simulated sample, and copy the current code.

Preview

Preview can clip large shadows; copied CSS is unchanged.

Button and states

Enter literal text and one class token. Edit each exported state.

12–32 px

0–64 px

0–32 px

0–8 px

0–64 px

Shared shadow

-32–32 px

-32–32 px

0–48 px

-16–16 px

Button code

The exported button is enabled.

Normal: 5.17:1 Meets 4.5:1 reference

Hover: 6.70:1 Meets 4.5:1 reference

Active: 8.72:1 Meets 4.5:1 reference

Disabled: 3.90:1 Inactive controls are exempt from this text-contrast requirement.

Focus ring against preview page: 5.17:1

Text reference assumes 16 px and weight 600; target 4.5:1.

The ring uses a 3:1 reference against the selected page color.

Solid-color ratios do not certify accessibility. Check keyboard focus, surrounding styles and actual use.

State and contrast

Foreground #FFFFFF against background #2563EB.

Relative luminances: foreground 1.000000, background 0.153152.

(lighter + 0.05) / (darker + 0.05) = 5.17:1.

Text reference assumes 16 px and weight 600; target 4.5:1.

Active overrides Hover; focus-visible adds an independent outline.

The displayed ratio is rounded; comparisons use the unrounded value.

Your label and styling stay in this browser; copy is explicit.

Style, inspect and copy a button

  1. Enter literal button text and one supported class token. Choose a system typeface, font size and weight, padding, border width and corner radius.
  2. Edit Normal, Hover, Active and Disabled surface colors and shadow choices. Focus edits the outline only, so it can remain visible over hover or pressed styling. Choose whether the exported HTML is disabled.
  3. Use Live and Tab to inspect real keyboard focus. State sample is a labelled simulation. Check the limited contrast readouts, then copy HTML and CSS separately; invalid exported fields withhold both.

Native semantics and interaction states

The HTML uses a native button with type="button", a class and literal text. It has no application action or event handler. Its explicit type avoids accidental form submission; you add the intended action in your own application.

Hover and pressed states can overlap. Active follows Hover and explicitly restores every surface property, including none for a removed shadow. Focus-visible adds an outline without changing that surface.

Native disabled is more than a visual color choice. The exported disabled attribute and live control suppress ordinary activation and keyboard focus. The editor and other preview controls remain usable.

One restricted class token keeps exported markup and selectors aligned. A class is not an arbitrary selector: spaces, commas, dots, pseudo-classes and leading digits are rejected instead of silently rewritten.

Text, state and contrast examples

The example label Save <draft> & "send" 🚀 stays literal text. Its HTML escapes the angle brackets and ampersand, so parsing the copied markup does not create an extra element.

The example uses blue Normal, darker Hover with a shadow, and Active equal to Normal without a shadow. Pressing while hovered must restore blue and remove the shadow, rather than leaving hover styling behind.

Black and white have a 21:1 contrast ratio; identical colors have 1:1. Text thresholds depend on authored size and weight, and comparisons use the unrounded ratio. A rounded display at a threshold is not proof the underlying value meets it.

Styling and accessibility limits

This tool uses opaque solid colors, one shared shadow shape, system-font presets and a bounded set of button properties. It has no gradient, animation, framework export, arbitrary CSS import, icon-only mode or application action.

State samples simulate appearance and are not interactive focus tests. Native focus-visible follows browser heuristics; use Live with actual keyboard input. Preview clipping of a large shadow does not rewrite copied CSS.

Solid-color contrast checks and minimum 44-pixel CSS dimensions do not certify accessibility. Focus area, surrounding backgrounds, shadows, clipping, obscuration, keyboard behavior, target context and assistive use need separate inspection.

Your page's styles, available width and installed fonts can affect the pasted control. Preview page colors and helper rules are not exported. The ring ratio uses only the selected page color, and disabled controls are exempt from the stated text-contrast requirement.

Local authoring without saved styles

The tool adds no upload, saved style history, input-bearing link, remote font request or telemetry containing your label and styling values. Copy is explicit. A mounted language change retains authored values; a new document starts defaults. Existing site services and extensions are outside a universal privacy promise.

Button styling questions

Active follows Hover and emits a complete surface, so pressed colors and shadow win. Focus-visible remains an independent outline when the browser matches it. Disabled controls are excluded from enabled rules.

No. It paints a simulated focus ring on an inert sample. Choose Live and use Tab and keyboard press/release to inspect real native focus behavior.

No. The export option adds the native disabled attribute. Its appearance comes from the Disabled surface, but native semantics come from the attribute rather than its colors.

No. Enter one class token beginning with an ASCII letter, followed by letters, digits, underscores or hyphens, at most 48 characters. The tool preserves valid case and rejects unsupported drafts.

The label is literal text, not markup. Angle brackets and ampersands are escaped in HTML, and the live preview sets text content. The generated button has no injected elements or event handlers.

No. The readouts cover declared opaque sRGB color pairs with stated font assumptions. They do not certify focus visibility, surrounding context, keyboard or assistive use. Disabled text has an exemption rather than a mandatory-pass badge.

Every surface has its own shadow-on choice. Active explicitly emits none when off, even if Hover had enabled the shared shadow. This prevents earlier hover styling from leaking into the pressed state.

The tool adds no saved history or input-bearing share link. Copy sends only the code you explicitly choose to the clipboard. A mounted language change retains authored values; a new document starts defaults.

Sources

Standards and guidance for native buttons and their states.

Reviewed 13 November 2026.

The generator accepts a restricted grammar, not all valid CSS.

SVG to PNG

Convert a local SVG file or pasted markup into PNG, with explicit dimensions, transparency and bundled fonts.

Open tool — SVG to PNG

CSS Filter Generator

Order and repeat CSS effects, compare a specimen and copy the exact filter declaration.

Open tool — CSS Filter Generator

Fluid Font Size Calculator

Create root-relative CSS from viewport endpoints and inspect the copied size model.

Open tool — Fluid Font Size Calculator

CSS Border Radius Generator

Edit eight corner radii, preview a box and copy CSS in pixels or percentages.

Open tool — CSS Border Radius Generator

CSS Grid Generator

Build a bounded CSS Grid example with editable tracks, placement and named areas. Preview it, copy CSS or HTML and download the same standalone example.

Open tool — CSS Grid Generator

CSS Flexbox Generator

Build a Flexbox example with container and item controls, explicit layout axes, matching CSS and HTML, and a local complete-example download.

Open tool — CSS Flexbox Generator

CSS Text Shadow Generator

Build ordered text shadows, preview plain text and copy exact CSS.

Open tool — CSS Text Shadow Generator

CSS Transform Generator

Compose repeatable 2D CSS transforms, edit px or percentage translation and origin, inspect a reference box and copy the exact current declarations.

Open tool — CSS Transform Generator

CSS Cubic Bezier Generator

Edit CSS cubic-bezier curves with coordinates, visual handles and presets. Inspect overshoot, run a deliberate comparison with linear motion, and copy easing CSS.

Open tool — CSS Cubic Bezier Generator

CSS Box Shadow Generator

Create ordered CSS box-shadow layers with a live preview and copyable code.

Open tool — CSS Box Shadow Generator

Image Watermark

Add a text or logo watermark to a batch of images, review each result and download individual files or a ZIP.

Open tool — Image Watermark

CSS Gradient Generator

Create linear or radial CSS gradients with editable colors, opacity and stops.

Open tool — CSS Gradient Generator

Color Converter

Convert supported sRGB HEX, RGB and HSL literals with alpha, explicit precision and current code Copy.

Open tool — Color Converter

Image to Text (OCR)

Recognize printed text in local PNG or JPEG images, choose a language and review or correct the result before copying or downloading.

Open tool — Image to Text (OCR)

QR Code Reader

Read one QR code from a local PNG or JPEG and inspect its text or content bytes without opening links.

Open tool — QR Code Reader

Color Contrast Checker

Compare foreground and background colors, adjust opacity and check WCAG numerical contrast thresholds for text and essential interface details.

Open tool — Color Contrast Checker

Print Size & Resolution Calculator

Calculate print dimensions, required pixels and effective PPI with fit or crop.

Open tool — Print Size & Resolution Calculator

Aspect Ratio Calculator

Find a width-to-height ratio or calculate a matching pixel size from one target dimension.

Open tool — Aspect Ratio Calculator

Image Compressor

Try to fit a JPEG, PNG or WebP within a target file size, with measured results and optional smaller dimensions.

Open tool — Image Compressor

HEIC to JPG

Convert supported HEIC photos locally into full-size JPG copies, with quality and background controls and verified individual or ZIP downloads.

Open tool — HEIC to JPG

Image Converter

Convert supported PNG, JPEG and WebP images locally with batch targets, transparency, background and quality controls, then review and download the encoded files.

Open tool — Image Converter

Photo Collage Maker

Arrange local photos in a grid, adjust crops and spacing, and download PNG or JPEG.

Open tool — Photo Collage Maker

Rotate & Flip Images

Rotate or mirror a local batch of static PNG, JPEG and WebP images, then review and download the processed results.

Open tool — Rotate & Flip Images

Image Cropper

Crop one local JPEG, PNG or WebP to exact pixels with visual and numeric controls. Download PNG or JPEG.

Open tool — Image Cropper
View all tools in this category