Skip to content
fixyour.page

CTA Button Generator

Generate CSS button code with live preview and customization.

Your data stays in your browser
Colors
Size
Font weight

Hover effects work on web pages only. Email clients don't run inline event handlers, so in an email the button stays in its base state.

Output mode
Get StartedHover to preview effect
Generated Code
<a href="https://example.com" style="display: inline-block; padding: 12px 20px; font-size: 16px; font-weight: 700; font-family: sans-serif; color: #FFFFFF; background-color: #FF6B00; border: 2px solid #FF6B00; border-radius: 4px; text-decoration: none; text-align: center; line-height: 1; cursor: pointer; transition: all 0.2s ease"
   onmouseover="this.style.cssText='display: inline-block; padding: 12px 20px; font-size: 16px; font-weight: 700; font-family: sans-serif; color: #FFFFFF; background-color: #FF6B00; border: 2px solid #FF6B00; border-radius: 4px; text-decoration: none; text-align: center; line-height: 1; cursor: pointer; transition: all 0.2s ease; filter: brightness(0.85)'"
   onmouseout="this.style.cssText='display: inline-block; padding: 12px 20px; font-size: 16px; font-weight: 700; font-family: sans-serif; color: #FFFFFF; background-color: #FF6B00; border: 2px solid #FF6B00; border-radius: 4px; text-decoration: none; text-align: center; line-height: 1; cursor: pointer; transition: all 0.2s ease'">Get Started</a>

How to Create a CTA Button

Pick your colors, set the size, adjust the border radius, and choose a hover effect. The preview updates instantly so you can see exactly what your button looks like before you copy the code. When you're happy with it, hit Copy or Download to grab the generated HTML. Use Inline Styles mode for email campaigns and embedded snippets, or CSS Class mode for websites where you want a reusable style.

What Makes a Good CTA Button?

High contrast between the button and its surroundings. Action-oriented text that tells people what happens when they click. "Start Free Trial" beats "Submit" every time. Size matters: the button needs to be large enough to tap on mobile (at least 44px touch target), but not so large it looks desperate. A subtle hover effect builds perceived interactivity and tells users the element is clickable. And whitespace around the button is just as important as the button itself. Crowded buttons get ignored.

Inline Styles vs. CSS Classes

Use inline styles when you can't control the stylesheet: email HTML, embedded widgets, CMS snippets with restricted editing. In email, a style block isn't guaranteed to arrive (the Gmail app drops it for non-Google accounts), so inline is the safe choice. The trade-off is hover. Inline mode has to fake it with onmouseover and onmouseout attributes. Those are script, and Outlook disables script in HTML mail, so treat hover as web-only. Use CSS Class mode for websites and landing pages where you can include a style block. You get cleaner HTML, real :hover support, and a class you can reuse across buttons.

Can I use this button in email campaigns? +
Yes. Use Inline Styles mode. It puts every style on the link itself, so the button doesn't depend on a style block surviving the trip. Don't count on the hover effect, though. Inline mode writes it as onmouseover and onmouseout attributes, which are script, and Outlook opens HTML mail with script disabled. We wouldn't bet on any other mail client running it either. Make the base state the one that does the work, because that's the one everyone sees.
What border radius should I use? +
It depends on your brand. Zero pixels gives you sharp, industrial corners. Four to eight pixels is the web standard: subtle rounding that softens the edges. Fifty pixels creates a pill-shaped button. Rounded buttons tend to test well in A/B experiments, but brand consistency matters more than marginal conversion differences.
Does the hover effect work on mobile? +
Hover effects require a cursor, so they don't apply on touchscreens. The button still looks and works fine. Mobile users see the default state. Focus on making the base state compelling on its own. The hover effect is a bonus for desktop users, not a requirement.
What colors should I use for my CTA button? +
High contrast between the button background and the page behind it. White text on a bold background color is the safest bet. The text color needs at least a 4.5:1 contrast ratio against the background to meet WCAG accessibility standards. Orange on white pages is a classic high-conversion combination. Avoid low-contrast combos like light gray on white. Nobody clicks what they can't see.