Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

CSS Button Designer

Visually design custom buttons with colors, borders, shadows, hover effects, and gradients — copy the CSS instantly

Your files never leave your browser
Text & Size
Text
Font Size16px
Weight
Padding H24px
Padding V12px
Text Color
Background
Color
Gradient
Border
Width0px
Color
Style
Radius8px
Shadow
Enable
X Offset0px
Y Offset4px
Blur12px
Spread0px
Color
Opacity25%
Hover Effects
Bg Color
Text Color
Scale1.05
Hover Shadow
Transition0.2s
Presets
Generated CSS

Pick colors, drag sliders for padding and border radius, toggle gradients and shadows, then preview hover effects — all updating a live button on screen. When it looks right, hit Copy CSS and paste the .btn and .btn:hover classes straight into your stylesheet. And everything runs in your browser. Nothing gets uploaded.

How It Works

Adjust Controls
→
Live Preview
→
Copy CSS

Every slider, color picker, and toggle writes inline CSS properties to the preview button in real time. The tool watches those computed styles and builds the corresponding .btn and .btn:hover rules. You get clean, production-ready CSS without touching a text editor until you are satisfied with the look.

Examples

Primary CTA for a SaaS Landing Page

Your homepage needs a bold "Start Free Trial" button with a hover lift effect.

INPUT
Background: #4f46e5 Text: #ffffff Padding: 14px 32px Border-radius: 8px Shadow: 0 4px 12px rgba(79,70,229,0.3) Hover scale: 1.03
OUTPUT
.btn { background: #4f46e5; color: #fff; padding: 14px 32px; border-radius: 8px; box-shadow: 0 4px 12px rgba(79,70,229,0.3); transition: all 0.2s; } .btn:hover { transform: scale(1.03); }

Ghost Outline Button for a Portfolio

Minimal style — transparent background, thin border, fills on hover.

INPUT
Background: transparent Text: #1f2937 Border: 2px solid #1f2937 Radius: 6px Hover BG: #1f2937 Hover text: #ffffff
OUTPUT
.btn { background: transparent; color: #1f2937; border: 2px solid #1f2937; border-radius: 6px; transition: all 0.25s; } .btn:hover { background: #1f2937; color: #fff; }

Gradient Pill Button for an E-commerce Checkout

A big, rounded "Buy Now" button with a purple-to-pink gradient and a glow shadow. You want it to feel clickable on mobile too.

INPUT
Gradient: #7c3aed → #ec4899 Direction: to right Padding: 16px 40px Radius: 999px Shadow: 0 6px 20px rgba(124,58,237,0.35) Hover shadow: 0 8px 28px rgba(236,72,153,0.4)
OUTPUT
.btn { background: linear-gradient( to right, #7c3aed, #ec4899); color: #fff; padding: 16px 40px; border-radius: 999px; box-shadow: 0 6px 20px rgba(124,58,237,0.35); transition: all 0.3s; } .btn:hover { box-shadow: 0 8px 28px rgba(236,72,153,0.4); }

Who Uses This

👨‍💻 Frontend Developers

Prototype button styles visually before committing CSS to a component library.

🎨 Web Designers

Test color combos, gradients, and shadows without opening a code editor at all.

📧 Email Marketers

Build styled CTA buttons and grab the inline CSS for HTML email templates.

🎓 Students

See how CSS properties like border-radius, box-shadow, and transitions actually work on a real element.

Common Mistakes

Forgetting to copy the code before closing

Your settings aren't saved between sessions. If you close the tab, your design is gone. Always copy the CSS output first — paste it into a file, a Gist, or even a sticky note.

Low contrast between text and background

White text on a light blue button looks fine on your monitor but fails WCAG contrast checks. Aim for at least a 4.5:1 ratio. When in doubt, go darker on the background or bolder on the text color.

Over-styling the hover state

Cranking the scale to 1.15 and adding a neon glow on hover feels dramatic — but it is distracting in production. Subtle changes (scale 1.02–1.05, slight shadow increase) usually work much better for real users.

Technical Details

Frequently Asked Questions

How do I add the generated CSS button to my website?

Copy the output code and paste it into your CSS file. Then add class="btn" to any <button> or <a> tag in your HTML. The hover styles are included automatically, so the transition kicks in without extra work.

Can I make gradient buttons with this designer?

Yes. Flip the gradient toggle on under the Background section. You'll get two color pickers and a direction dropdown. Pick your start and end colors, choose a direction like "to right" or "45deg," and the preview updates instantly.

Does the generated CSS work on mobile?

The CSS properties used here — padding, border-radius, box-shadow, transitions — are supported on every modern mobile browser. Buttons scale with their text content, so they adapt to smaller screens without extra media queries. Just make sure your padding isn't so large it overflows narrow viewports.

Is there a way to save my button designs?

The tool doesn't store anything — it runs entirely in your browser. Your best bet is to copy the CSS and save it in a file or code snippet manager. If you want to come back and tweak later, paste the old values back into the controls manually.

What's the difference between box-shadow and hover shadow?

Box-shadow is the default shadow that's always visible. Hover shadow only appears when someone moves their cursor over the button. A common pattern is a subtle shadow at rest and a bigger, softer shadow on hover — it creates a "lift" effect that makes the button feel interactive.

Share: