SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/glowing-border-buttons

7 CSS Glowing Border Buttons

5 Pure CSS2 with JSPublished 2026-10-05Free · no sign-up

Seven ways to make a button glow: a spinning conic-gradient ring, a neon glow on hover, a pulsing ring for a live action, a beam of light that runs round the edge, a soft coloured glow for light pages, a glow that follows the cursor and a glow that marks the selected option.

01. Rotating Conic Glow Border

GlowAnimation

A conic gradient spins behind the button and only a 2px ring of it shows, with a blurred copy underneath for the glow. The angle is a registered @property so the browser can animate it; browsers without @property show the ring standing still.

View code
<button class="gbb1"><span>Launch project</span></button>
@property --gbb1a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.gbb1 { position: relative; padding: 2px; border: 0; border-radius: 14px; background: conic-gradient(from var(--gbb1a), #22d3ee, #a855f7, #f43f5e, #22d3ee); cursor: pointer; animation: gbb1 4s linear infinite; }
.gbb1::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; filter: blur(12px); opacity: .7; z-index: -1; }
.gbb1 span { display: block; padding: 14px 26px; border-radius: 12px; background: #0e1118; color: #fff; font: 700 16px Inter, system-ui, sans-serif; }
@keyframes gbb1 { to { --gbb1a: 360deg; } }
.gbb1:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }
@media (prefers-reduced-motion: reduce) { .gbb1 { animation: none; } }

02. Glow on Hover Only

GlowHover

At rest this is a plain outlined button. On hover and focus the border turns cyan and stacked box-shadows, one tight, one wide and one inset, create a neon glow. Animating box-shadow is acceptable here because the transition is short and only runs on interaction.

View code
<button class="gbb2">Connect wallet</button>
.gbb2 { padding: 14px 26px; border: 1px solid #2f3a5c; border-radius: 10px; background: #111627; color: #cfd8ff; font: 600 16px Inter, system-ui, sans-serif; cursor: pointer; transition: border-color .25s, box-shadow .25s, color .25s; }
.gbb2:hover, .gbb2:focus-visible { border-color: #22d3ee; color: #fff; box-shadow: 0 0 0 1px #22d3ee, 0 0 18px rgba(34,211,238,.55), inset 0 0 12px rgba(34,211,238,.15); outline: none; }

03. Pulsing Glow Ring

GlowAttention

A ring of glow expands from the button and fades every two seconds, to draw the eye to a single action such as Go live. The ring is an animated box-shadow on a pseudo-element. Use it sparingly, and never on more than one button in view.

View code
<button class="gbb3"><span class="dot" aria-hidden="true"></span>Go live</button>
.gbb3 { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border: 0; border-radius: 999px; background: #dc2626; color: #fff; font: 800 16px Inter, system-ui, sans-serif; cursor: pointer; }
.gbb3::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(248,113,113,.7); animation: gbb3 2s ease-out infinite; }
.gbb3 .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; }
@keyframes gbb3 { to { box-shadow: 0 0 0 16px rgba(248,113,113,0); } }
.gbb3:focus-visible { outline: 3px solid #fecaca; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .gbb3::after { animation: none; } }

04. Light Beam Around the Edge

GlowAnimation

A narrow beam of light travels around the border: a conic gradient with one bright slice, masked so only a 1.5px ring is visible. The mask is two layers combined with exclude, which cuts the inside out and leaves the button background untouched.

View code
<button class="gbb4">Upgrade to Pro</button>
@property --gbb4a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.gbb4 { position: relative; padding: 15px 28px; border: 0; border-radius: 12px; background: #0f1322; color: #e9e7ff; font: 700 16px Inter, system-ui, sans-serif; cursor: pointer; }
.gbb4::before { content: ""; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; background: conic-gradient(from var(--gbb4a), transparent 0 75%, #c4b5fd 88%, #fff 92%, transparent 96%), #2c2f4d; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: gbb4 3s linear infinite; pointer-events: none; }
@keyframes gbb4 { to { --gbb4a: 360deg; } }
.gbb4:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .gbb4::before { animation: none; } }

05. Soft Coloured Glow

GlowShadow

On a light page a neon glow looks out of place, so this one uses a coloured, blurred shadow under the button instead. The shadow is the button colour at low opacity and grows slightly on hover, which reads as glow and lift together.

View code
<button class="gbb5">Subscribe</button>
.gbb5 { padding: 15px 32px; border: 0; border-radius: 12px; background: #7c3aed; color: #fff; font: 700 16px Inter, system-ui, sans-serif; cursor: pointer; box-shadow: 0 10px 24px -8px rgba(124,58,237,.6); transition: box-shadow .25s, transform .25s; }
.gbb5:hover, .gbb5:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 32px -8px rgba(124,58,237,.75); }
.gbb5:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .gbb5 { transition: none; } .gbb5:hover, .gbb5:focus-visible { transform: none; } }

06. Glow That Follows the Cursor

GlowJavaScript

A radial highlight on the border follows the pointer. A few lines of script write the pointer position into two custom properties, and the border is a masked radial gradient centred on them. Without JavaScript the button simply has a plain border.

View code
<button class="gbb6">Try the playground</button>
.gbb6 { --x: 50%; --y: 50%; position: relative; padding: 16px 30px; border: 0; border-radius: 14px; background: #121726; color: #f1f5ff; font: 700 16px Inter, system-ui, sans-serif; cursor: pointer; }
.gbb6::before { content: ""; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; background: radial-gradient(120px circle at var(--x) var(--y), #38bdf8, transparent 70%), #2a324d; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); pointer-events: none; }
.gbb6:focus-visible { outline: 2px solid #38bdf8; outline-offset: 4px; }
var b = document.querySelector('.gbb6');
b.addEventListener('pointermove', function (e) {
  var r = b.getBoundingClientRect();
  b.style.setProperty('--x', (e.clientX - r.left) + 'px');
  b.style.setProperty('--y', (e.clientY - r.top) + 'px');
});

07. Glowing Selected Option

GlowGroup

Glow as a selection state: three billing buttons in a group, and the one with aria-pressed set to true glows. Clicking moves the glow, and the pressed state is announced, so the highlight is never the only cue.

View code
<div class="gbb7" role="group" aria-label="Billing period"><button aria-pressed="false">Monthly</button><button aria-pressed="true">Yearly</button><button aria-pressed="false">Lifetime</button></div>
.gbb7 { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; box-sizing: border-box; max-width: 100%; }
.gbb7 button { padding: 12px 18px; border: 1px solid #2c3554; border-radius: 10px; background: #121828; color: #aab4d4; font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; transition: box-shadow .25s, border-color .25s, color .25s; }
.gbb7 [aria-pressed="true"] { border-color: #a78bfa; color: #fff; box-shadow: 0 0 0 1px #a78bfa, 0 0 22px rgba(167,139,250,.45); }
.gbb7 button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
document.querySelectorAll('.gbb7 button').forEach(function (b, _, all) {
  b.addEventListener('click', function () { all.forEach(function (x) { x.setAttribute('aria-pressed', x === b ? 'true' : 'false'); }); });
});

About these CSS Glowing Border Buttons

Animated borders with @property

A conic gradient can only rotate smoothly if the browser knows its angle is an angle. Register it with @property and animate the custom property; browsers without support show the same ring, just still.

Masking a ring

To show a gradient only on the border, put it on a pseudo-element with padding equal to the border width and mask out the content box. Two mask layers with exclude (or xor in older WebKit) leave just the ring.

Glow is box-shadow

Most glows are stacked box-shadows: a tight one for the bright edge, a wide blurred one for the halo and sometimes an inset one inside. Coloured, low-opacity shadows read as glow on light backgrounds too.

One glowing thing at a time

Glow pulls the eye. Use it on one primary action or to mark a selected state, and never make it the only signal: pair it with a border colour, a label or aria-pressed.

Frequently asked questions

Why does the border not rotate in my browser?

Rotation needs @property, supported in all current major browsers. Older versions show a static ring.

Are glowing buttons accessible?

They can be: each demo keeps readable text, a visible focus outline and a reduced-motion fallback.

Will the glow get cut off?

Glows extend outside the button, so leave some space around it or the parent's overflow: hidden will clip them.