CSS Glossy Button
A shiny gel pill button with a glass highlight on top, inspired by early-2000s interfaces.
<button class="btn-glossy">Download</button>
.btn-glossy {
position: relative;
padding: 15px 40px;
border: 1px solid #1e40af;
border-radius: 999px;
background: linear-gradient(#3b82f6, #1d4ed8 60%, #1e40af);
color: #fff;
font: 700 16px/1 system-ui, sans-serif;
text-shadow: 0 -1px 0 #1e3a8a;
box-shadow:
inset 0 -3px 6px #60a5fa,
0 6px 12px -4px #1e40af;
cursor: pointer;
transition: filter 0.2s ease;
}
/* The glass highlight */
.btn-glossy::before {
content: "";
position: absolute;
top: 2px;
left: 10%;
right: 10%;
height: 42%;
border-radius: 999px;
background: linear-gradient(#ffffffb3, #ffffff14);
pointer-events: none;
}
.btn-glossy:hover {
filter: brightness(1.1) saturate(1.1);
}
.btn-glossy:active {
box-shadow:
inset 0 2px 6px #1e3a8a,
0 2px 6px -2px #1e40af;
}
.btn-glossy:focus-visible {
outline: 3px solid #1d4ed8;
outline-offset: 3px;
}
About this CSS Glossy Button
This CSS Glossy Button is 43 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, linear gradients, box shadows and text shadows. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#1e40af#3b82f6#1d4ed8#fff#1e3a8a#60a5fa#ffffffb3#ffffff14
How to use this glossy button
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.btn-glossyclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.