Return to Projects
Tutorial HTML CSS Beginner No JS ~10 min read

Glowing Animated Text Button
Neon Hover Effect — Pure HTML & CSS

Build a futuristic glowing animated text button with neon hover effects, text stroke fill animation, and drop-shadow glow using only HTML and CSS. Zero JavaScript required.

6 Build Steps
0 Lines of JS
2 CSS Properties
Free Source Code
Glowing animated text button showing neon cyan text stroke effect with hover fill animation on dark background

Final result: A text button that glows and fills with light on hover

What You'll Build

This tutorial walks you through creating a premium glowing animated text button that's perfect for menu components, call-to-action sections, or any futuristic UI. Here's what makes it special:

🌟
Neon Glow Effect
Drop-shadow filter creates a realistic neon light glow around the text
✍️
Text Stroke Outline
Hollow text using -webkit-text-stroke that fills in on hover
Smooth Fill Animation
Left-to-right text fill with CSS width transition for a cinematic reveal
📱
Fully Responsive
Scales beautifully on all screen sizes without breaking the effect
Zero JavaScript
Pure CSS solution — no JS libraries or dependencies needed
🎨
Easy Customization
Change glow color, speed, and text with simple CSS variable edits

Step-by-Step Build Guide

1

Create the Button HTML Structure

Start with a <button> element. Inside it, include two <span> elements — one for the regular outlined text and another for the animated glowing text that appears on hover. The button wrapper uses overflow: hidden to clip the fill animation.

HTML structure showing button element with two nested spans for stroke and fill text

The dual-span structure enables the stroke-to-fill transition

2

Apply Text Stroke & Transparent Fill

Use -webkit-text-stroke to create the outlined text effect. Set color: transparent so only the stroke outline is visible initially. This gives the button a hollow, wireframe look before interaction.

💡 Pro Tip: The -webkit-text-stroke property is supported by all modern browsers. The -webkit- prefix is required even in Firefox and Edge for this specific property.
3

Set Up the Glowing Fill Span

Style the second <span> with a solid color (e.g., cyan or white) and position it absolutely over the stroke text. Set its initial width: 0% so it's completely hidden. The overflow: hidden on the parent button ensures the fill is clipped until triggered.

4

Add the Hover Fill Transition

On button:hover, animate the inner span's width from 0% to 100% using a CSS transition. This creates a smooth left-to-right fill effect. A duration of 3–5 seconds gives an elegant, cinematic feel.

CSS code showing hover transition for width property on the fill span

The width transition creates the left-to-right text fill reveal

5

Apply Drop-Shadow for Neon Glow

Use filter: drop-shadow() on the button to create the neon glow effect. Unlike text-shadow, drop-shadow follows the actual rendered shape of the text stroke, producing a more authentic glow. Stack multiple drop-shadows for increased intensity.

⚠️ Important: Avoid using text-shadow for this effect — it only applies to the text fill, not the stroke outline. filter: drop-shadow() respects the full rendered shape including strokes.
6

Fine-Tune Timing & Colors

Adjust the transition-duration (3–5s recommended), cubic-bezier timing function, and glow color to match your site's theme. You can also add a subtle @keyframes pulse animation for a breathing glow effect on the idle state.

✅ Result: When you hover over the button, the glowing text smoothly fills from left to right with a trailing neon glow — perfect for "Subscribe", "Join", or "Download" actions.
Final preview of the glowing animated text button with neon cyan glow

The completed button with smooth hover fill animation and neon glow

CSS Properties Reference

Here's a quick reference of the key CSS properties used in this project and what each one does:

Property Purpose Key Value
-webkit-text-stroke Creates outlined/hollow text by drawing a border around each character 1px #00d9ff
filter: drop-shadow() Adds a glow that follows the actual rendered shape including strokes 0 0 10px cyan
transition Animates the width change for the fill effect on hover width 3s ease
overflow: hidden Clips the fill span so it reveals progressively left-to-right hidden
position: absolute Overlaps the fill span exactly on top of the stroke text absolute
color: transparent Hides the text fill so only the stroke outline is visible initially transparent

Best Practices

📖 Readable Text

Ensure the glow doesn't reduce text contrast. Test on dark and light backgrounds.

🎨 Consistent Palette

Match the glow color with your site's accent color for visual harmony.

⏱️ Moderate Speed

Keep transitions between 3–5 seconds. Too fast looks jittery, too slow feels unresponsive.

♿️ Accessibility

Maintain focus visibility for keyboard navigation. Add focus-visible styles matching the glow.

Common Mistakes to Avoid

  • Using text-shadow instead of drop-shadow — the shadow won't follow the stroke outline
  • Using overly bright glow colors (e.g., pure white at full opacity) that strain the eyes
  • Applying too many simultaneous animations, causing performance issues on low-end devices
  • Forgetting overflow: hidden on the button, which breaks the fill clip effect
  • Neglecting responsive sizing — the text may overflow or become unreadable on small screens
  • Ignoring text alignment and padding consistency across different button instances

Full Source Code (Free)

The entire project lives in a single HTML file — no external CSS or JS files required. The HTML sets up the card structure and links images from picsum.photos for demonstration. The CSS drives every animation, transition, and responsive breakpoint. A four-line script at the bottom removes the shimmer placeholder once each image has loaded. Use the tabs below to explore the HTML and CSS sections separately.

HTML — index.html
CSS — style.css

🔓 Full Source Code unlocks in

05

Hosted on GitHub Gist — free, no sign-up required

💡 Quick Start: Copy the full code into a single index.html file. No build tools, no npm, no libraries — open it in any modern browser and the accordion gallery works immediately. Swap the picsum.photos URLs with your own images to customize it instantly.

Frequently Asked Questions

How does the CSS text stroke effect work?
The -webkit-text-stroke property draws an outline around text characters. When combined with color: transparent, only the stroke outline is visible, creating a hollow text effect. On hover, a second <span> with a solid color fills in from left to right, creating the animation. The stroke width and color are fully customizable.
What is the difference between text-shadow and drop-shadow for button glow?
text-shadow only applies to the text fill content and doesn't follow transparent areas or stroke outlines. filter: drop-shadow() creates a shadow based on the actual rendered shape of the element — including the -webkit-text-stroke outline. This makes drop-shadow the correct choice for glowing outlined text where you want the glow to follow the stroke path precisely.
Can I change the glow color and animation speed?
Yes. To change the glow color, modify the drop-shadow() color values and the -webkit-text-stroke color. For animation speed, adjust the transition-duration property on the button (e.g., transition: all 3s ease for a 3-second fill). You can also change the cubic-bezier timing function for different easing curves like bounce or elastic feel.
Does this glowing button work on all browsers?
The -webkit-text-stroke property works in all modern browsers including Chrome, Firefox, Safari, and Edge. The filter: drop-shadow() is also widely supported with full browser coverage. For older browsers that don't support these properties, the button will still function as a clickable element — it degrades gracefully, just without the visual glow and stroke effects.
Can I use this effect on links or div elements instead of buttons?
Absolutely. The effect uses standard CSS properties that work on any HTML element. You can apply the same classes to <a>, <div>, or <span> elements. Just ensure you add cursor: pointer for visual feedback and appropriate ARIA attributes (like role="button" and tabindex="0") for accessibility on non-button elements.
How do I make the glow animation more subtle or more intense?
For a subtler glow, reduce the blur radius in drop-shadow() (e.g., drop-shadow(0 0 3px cyan)) and lower the color opacity. For more intensity, stack multiple drop-shadow filters with increasing blur: filter: drop-shadow(0 0 5px cyan) drop-shadow(0 0 15px cyan) drop-shadow(0 0 30px cyan). You can also add a pulsing @keyframes animation that cycles the shadow intensity for a breathing glow effect.

Conclusion

Building a glowing animated text button with HTML and CSS is an easy yet powerful way to make your website stand out. This effect delivers interactivity, modern style, and performance efficiency — all without a single line of JavaScript.

  • Pure CSS solution — no JavaScript dependencies
  • Neon glow effect using filter: drop-shadow()
  • Cinematic text fill animation with width transition
  • Fully customizable colors, speed, and timing
  • Works across all modern browsers with graceful degradation
  • Perfect for Subscribe, Join, Download, and Explore actions