CSS Button Styles: 20+ Examples With Code (2026)
CSS button styles are one of the most searched UI topics for good reason — buttons drive every key user action on a website. Whether it's a "Buy Now" CTA, a form submit, or a navigation toggle, a poorly styled button kills conversions. This guide gives you 20+ production-ready CSS button examples with complete, copy-paste code covering every modern design style used in 2026.
From minimal flat buttons to animated glassmorphism designs, you'll find a button style for every project type — SaaS, portfolio, agency, or startup landing page.
TL;DR: Skip to any section using the headings below. Every example includes full HTML + CSS you can drop into your project immediately.
What Are CSS Button Styles?
CSS button styles refer to the visual and interactive properties applied to <button> or <a> elements using CSS. Good button design in CSS goes beyond color — it covers shape, spacing, hover states, focus rings (accessibility), and micro-animations that signal interactivity to users.
Every professional UI uses intentional button styling. Unstyled or poorly styled buttons are the single fastest way to make a site look unfinished. If you're building components or templates, visit the ProofMatcher CSS UI components library for pre-built, production-ready button components.
CSS Button Styles: 20+ Examples With Code
1. Minimal Flat Button
The cleanest possible button design. No shadows, no gradients — just solid color and sharp edges. Works in any design system.
<!-- Minimal flat button -->
<button class="btn-flat">Get Started</button>
/* Minimal flat button */
.btn-flat {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 12px 28px;
background: #111;
color: #fff;
font-size: 14px;
font-weight: 600;
letter-spacing: 0.04em;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s ease, transform 0.15s ease;
}
.btn-flat:hover {
background: #333;
transform: translateY(-1px);
}
.btn-flat:focus-visible {
outline: 2px solid #111;
outline-offset: 3px;
}
.btn-flat:active {
transform: translateY(0);
}
Best for: Dark-mode SaaS apps, minimal portfolios, developer tools.
2. Gradient Button
A classic high-conversion button style. The gradient creates depth without shadows, making it pop on both light and dark backgrounds.
/* Gradient button */
.btn-gradient {
display: inline-flex;
align-items: center;
padding: 13px 32px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #fff;
font-size: 14px;
font-weight: 700;
border: none;
border-radius: 8px;
cursor: pointer;
transition: opacity 0.2s ease, transform 0.15s ease;
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.btn-gradient:hover {
opacity: 0.92;
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}
.btn-gradient:active {
transform: translateY(0);
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}
Best for: SaaS landing pages, hero section CTAs, pricing tables.
3. Outline / Ghost Button
Ghost buttons are the secondary action standard. They pair with solid primary buttons to create clear visual hierarchy.
/* Ghost / outline button */
.btn-ghost {
display: inline-flex;
align-items: center;
padding: 12px 28px;
background: transparent;
color: #111;
font-size: 14px;
font-weight: 600;
border: 2px solid #111;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s ease, color 0.2s ease;
}
.btn-ghost:hover {
background: #111;
color: #fff;
}
/* Dark mode variant */
.dark .btn-ghost {
color: #fff;
border-color: #fff;
}
.dark .btn-ghost:hover {
background: #fff;
color: #111;
}
Best for: Secondary CTAs, "Learn more" buttons, modal cancel actions. Browse more in the ProofMatcher free CSS UI components library.
4. Glassmorphism Button
Frosted glass buttons are a dominant 2026 design trend. They work beautifully over gradient or image backgrounds.
/* Glassmorphism button */
.btn-glass {
display: inline-flex;
align-items: center;
padding: 13px 30px;
background: rgba(255, 255, 255, 0.12);
color: #fff;
font-size: 14px;
font-weight: 600;
border: 1px solid rgba(255, 255, 255, 0.25);
border-radius: 10px;
cursor: pointer;
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
transition: background 0.25s ease, border-color 0.25s ease;
}
.btn-glass:hover {
background: rgba(255, 255, 255, 0.22);
border-color: rgba(255, 255, 255, 0.4);
}
.btn-glass:focus-visible {
outline: 2px solid rgba(255,255,255,0.6);
outline-offset: 3px;
}
Best for: Hero sections with gradient backgrounds, dark mode dashboards, premium landing pages.
5. Neumorphic Button
Soft UI with inset shadow effects. Subtle and tactile — best used sparingly on light neutral backgrounds.
/* Neumorphic button */
.btn-neu {
display: inline-flex;
align-items: center;
padding: 14px 32px;
background: #e0e5ec;
color: #555;
font-size: 14px;
font-weight: 600;
border: none;
border-radius: 12px;
cursor: pointer;
box-shadow: 6px 6px 12px #b8bec7, -6px -6px 12px #ffffff;
transition: box-shadow 0.2s ease;
}
.btn-neu:hover {
box-shadow: 4px 4px 8px #b8bec7, -4px -4px 8px #ffffff;
}
.btn-neu:active {
box-shadow: inset 4px 4px 8px #b8bec7, inset -4px -4px 8px #ffffff;
}
Best for: Finance dashboards, health apps, minimal product landing pages.
6. Animated Shimmer Button
A moving highlight animation gives the button a premium, interactive feel — no JavaScript required.
/* Shimmer button */
.btn-shimmer {
position: relative;
display: inline-flex;
align-items: center;
padding: 13px 32px;
background: #111;
color: #fff;
font-size: 14px;
font-weight: 700;
border: none;
border-radius: 8px;
cursor: pointer;
overflow: hidden;
}
.btn-shimmer::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 60%;
height: 100%;
background: linear-gradient(
120deg,
transparent,
rgba(255,255,255,0.15),
transparent
);
transition: left 0.5s ease;
}
.btn-shimmer:hover::before {
left: 140%;
}
Best for: Hero CTAs, premium product pages, signup buttons. See it in action in ProofMatcher's interactive CSS button components.
7. Icon + Text Button
/* Icon button with flex layout */
.btn-icon {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 24px;
background: #2563eb;
color: #fff;
font-size: 14px;
font-weight: 600;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background 0.2s ease;
}
.btn-icon svg {
width: 16px;
height: 16px;
flex-shrink: 0;
}
.btn-icon:hover {
background: #1d4ed8;
}
8. Pill / Rounded Button
/* Pill button */
.btn-pill {
display: inline-flex;
align-items: center;
padding: 12px 36px;
background: #10b981;
color: #fff;
font-size: 14px;
font-weight: 700;
border: none;
border-radius: 9999px;
cursor: pointer;
transition: background 0.2s ease, transform 0.15s ease;
box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-pill:hover {
background: #059669;
transform: scale(1.03);
}
9. Danger / Delete Button
/* Danger button */
.btn-danger {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 10px 22px;
background: #ef4444;
color: #fff;
font-size: 13px;
font-weight: 600;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s ease;
}
.btn-danger:hover { background: #dc2626; }
.btn-danger:focus-visible {
outline: 2px solid #ef4444;
outline-offset: 3px;
}
10. Loading / Spinner Button
/* Loading button */
.btn-loading {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 28px;
background: #6366f1;
color: #fff;
font-size: 14px;
font-weight: 600;
border: none;
border-radius: 8px;
cursor: not-allowed;
opacity: 0.85;
}
.btn-loading .spinner {
width: 14px;
height: 14px;
border: 2px solid rgba(255,255,255,0.3);
border-top-color: #fff;
border-radius: 50%;
animation: spin 0.7s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
11. 3D Press Button
/* 3D press button */
.btn-3d {
display: inline-flex;
align-items: center;
padding: 13px 30px;
background: #f59e0b;
color: #111;
font-size: 14px;
font-weight: 800;
border: none;
border-radius: 8px;
cursor: pointer;
box-shadow: 0 6px 0 #b45309;
transform: translateY(0);
transition: box-shadow 0.1s ease, transform 0.1s ease;
}
.btn-3d:hover { box-shadow: 0 4px 0 #b45309; transform: translateY(2px); }
.btn-3d:active { box-shadow: 0 0 0 #b45309; transform: translateY(6px); }
12. Neon Glow Button
/* Neon glow button — dark backgrounds only */
.btn-neon {
display: inline-flex;
align-items: center;
padding: 12px 30px;
background: transparent;
color: #39ff14;
font-size: 14px;
font-weight: 700;
letter-spacing: 0.1em;
border: 2px solid #39ff14;
border-radius: 6px;
cursor: pointer;
text-transform: uppercase;
box-shadow: 0 0 8px #39ff14, inset 0 0 8px rgba(57,255,20,0.1);
transition: box-shadow 0.3s ease;
}
.btn-neon:hover {
box-shadow: 0 0 20px #39ff14, 0 0 40px rgba(57,255,20,0.4),
inset 0 0 12px rgba(57,255,20,0.2);
}
13–20. Additional Quick Variants
/* Social / Brand button */
.btn-social {
display: inline-flex; align-items: center; gap: 10px;
padding: 12px 24px; background: #1da1f2; color: #fff;
font-size: 14px; font-weight: 600; border: none;
border-radius: 6px; cursor: pointer;
}
/* Text-only / Link button */
.btn-text {
background: none; border: none; padding: 4px 0;
color: #6366f1; font-size: 14px; font-weight: 600;
cursor: pointer; text-decoration: underline;
text-underline-offset: 3px;
}
/* Glow pulse button */
.btn-pulse {
padding: 12px 28px; background: #ec4899; color: #fff;
border: none; border-radius: 8px; cursor: pointer;
font-weight: 700; animation: pulse-glow 2s ease infinite;
}
@keyframes pulse-glow {
0%, 100% { box-shadow: 0 0 0 0 rgba(236,72,153,0.4); }
50% { box-shadow: 0 0 0 10px rgba(236,72,153,0); }
}
/* Dark mode CTA */
.btn-dark-cta {
padding: 14px 36px; background: #fff; color: #111;
font-size: 15px; font-weight: 800; border: none;
border-radius: 8px; cursor: pointer;
box-shadow: 0 4px 24px rgba(255,255,255,0.15);
transition: transform 0.15s ease;
}
.btn-dark-cta:hover { transform: scale(1.02); }
CSS Button Best Practices
- Minimum 44x44px tap target — WCAG 2.5.5 requirement for touch devices
- Always include
:focus-visible— keyboard users need visible focus rings - Use
transitionon:hover— never apply transitions only on:hover; put them on the base state - Contrast ratio ≥ 4.5:1 — text against button background must meet WCAG AA
- Use
cursor: pointeron all button elements — the browser default for<button>isauto - Avoid
outline: nonewithout a replacement — this breaks keyboard accessibility - Test
:activestates on mobile — desktop hover ≠ mobile tap behavior
Pro tip: Use CSS custom properties for button tokens. Define--btn-color,--btn-radius, and--btn-paddingat the root level so you can theme your entire button system from one place.
Button Design Use Cases
SaaS products — Use gradient or flat primary buttons for plan upgrades and "Start Free Trial" CTAs. Ghost buttons work well for secondary actions like "View Demo."
Developer portfolios — Minimal or glassmorphism buttons match the clean aesthetic. Use pill buttons for skill tags and contact CTAs. Download a free developer portfolio template with pre-styled buttons included.
Agency websites — 3D press buttons and shimmer effects add premium feel to project CTAs. Pair with ghost buttons for "View Case Study" secondary actions.
Startup landing pages — Pulsing or glow buttons on hero sections outperform static buttons in A/B tests. Browse startup landing page templates with optimized CTA button layouts.
Explore More ProofMatcher Resources
Every example above can be explored interactively in the ProofMatcher CSS UI components library — copy code, preview live, and drop components directly into your project.
- 🔗 Browse free CSS button components — interactive previews with copy-paste code
- 🔗 Download free website templates — every template includes a complete button system
- 🔗 Explore SaaS landing page templates — optimized CTAs, conversion-first layouts
- 🔗 Browse dark mode website templates — neon, glassmorphism, and glow button styles in context
Frequently Asked Questions
What is the best CSS button style for conversions?
Solid contrast buttons with clear text outperform decorative styles in most A/B tests. Use gradient or colored flat buttons for primary CTAs. Ensure the button label is action-oriented: "Start Free Trial" beats "Submit."
How do I make a CSS button hover effect?
Add a transition on the base element, then define the changed state in :hover. Example: transition: background 0.2s ease; on the button, then .btn:hover { background: #333; }.
How do I style a button without using a framework?
All examples in this guide are pure CSS — no Tailwind, Bootstrap, or JavaScript required. Copy the CSS class and apply it to any <button> element.
What is a ghost button in CSS?
A ghost button (also called an outline button) has a transparent background with a visible border. It's used for secondary actions where you don't want to compete visually with the primary CTA button.
How do I add a loading spinner to a CSS button?
Use a ::before pseudo-element or an inner <span> with a CSS @keyframes rotation animation, as shown in example 10 above. Set cursor: not-allowed and reduce opacity while loading.
Conclusion
CSS button styles are a foundational skill for every frontend developer. Whether you need a minimal flat button for a developer portfolio or an animated glassmorphism CTA for a SaaS landing page, the 20+ examples above give you a complete toolkit for 2026.
Copy any example, adapt the colors to your design system, and you're ready to ship. For a complete component library with live previews, visit ProofMatcher's CSS UI components. Need a full page template with buttons already integrated? Download a free website template and customize it in minutes.
Which button style do you use most in your projects? Let us know in the comments.