31 CSS Hero Sections24 / 31
Neon CTA Hero
Tokyo-cyberpunk neon CTA — pure black backdrop, neon pink and electric cyan glows, single CTA that breathes with a soft pulse. The conversion-funnel pattern.
Published
The code
<section class="hs-24" aria-label="Hero">
<span class="hs-24__grid" aria-hidden="true"></span>
<div class="hs-24__inner">
<span class="hs-24__eye">/ ENTER THE NIGHT MARKET</span>
<h2>Order ramen at <em>3 a.m.</em> like the locals do.</h2>
<p>50 Tokyo back-alley vendors. One delivery app. One foreigner-friendly menu.</p>
<a class="hs-24__cta" href="#order">Open the menu</a>
</div>
</section><section class="hs-24" aria-label="Hero">
<span class="hs-24__grid" aria-hidden="true"></span>
<div class="hs-24__inner">
<span class="hs-24__eye">/ ENTER THE NIGHT MARKET</span>
<h2>Order ramen at <em>3 a.m.</em> like the locals do.</h2>
<p>50 Tokyo back-alley vendors. One delivery app. One foreigner-friendly menu.</p>
<a class="hs-24__cta" href="#order">Open the menu</a>
</div>
</section>.hs-24 {
position: relative;
overflow: hidden;
display: grid;
place-items: center;
width: 100%;
min-height: 100vh;
padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 56px);
background: #0a0014;
font-family: 'Inter', system-ui, sans-serif;
color: #fff;
box-sizing: border-box;
contain: layout paint;
}
.hs-24__grid {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 220%;
height: 50%;
background: repeating-linear-gradient(0deg, transparent 0 24px, rgba(238,82,206,0.32) 24px 25px), repeating-linear-gradient(90deg, transparent 0 24px, rgba(34,211,238,0.32) 24px 25px);
transform: translateX(-50%) perspective(800px) rotateX(60deg);
transform-origin: center top;
mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
-webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
pointer-events: none;
}
.hs-24__inner {
position: relative;
z-index: 1;
max-width: 720px;
text-align: center;
}
.hs-24__eye {
display: inline-block;
font-family: 'JetBrains Mono', monospace;
font-size: 11.5px;
letter-spacing: 0.24em;
color: #22d3ee;
padding: 4px 14px;
border: 1px solid #22d3ee;
text-shadow: 0 0 10px rgba(34,211,238,0.6);
margin-bottom: 22px;
}
.hs-24 h2 {
margin: 0 0 18px;
font-size: clamp(36px, 6vw, 64px);
font-weight: 900;
letter-spacing: -0.02em;
line-height: 1.05;
text-shadow: 0 0 30px rgba(238,82,206,0.4);
}
.hs-24 h2 em {
color: #ee52ce;
font-style: italic;
text-shadow: 0 0 18px rgba(238,82,206,0.7);
}
.hs-24 p {
margin: 0 auto 28px;
font-size: 16px;
color: #a890c8;
max-width: 460px;
line-height: 1.55;
}
.hs-24__cta {
display: inline-block;
padding: 14px 36px;
background: transparent;
color: #ee52ce;
border: 2px solid #ee52ce;
border-radius: 0;
font-weight: 800;
font-size: 15px;
letter-spacing: 0.12em;
text-transform: uppercase;
text-decoration: none;
box-shadow: 0 0 18px rgba(238,82,206,0.5), inset 0 0 18px rgba(238,82,206,0.18);
animation: hs-24-pulse 2.4s ease-in-out infinite alternate;
transition: background 0.15s, color 0.15s;
}
@keyframes hs-24-pulse {
from {
box-shadow: 0 0 14px rgba(238,82,206,0.4), inset 0 0 14px rgba(238,82,206,0.14);
}
to {
box-shadow: 0 0 28px rgba(238,82,206,0.7), inset 0 0 24px rgba(238,82,206,0.28);
}
}
.hs-24__cta:hover {
background: #ee52ce;
color: #0a0014;
}
@media (prefers-reduced-motion: reduce) {
.hs-24__cta {
animation: none;
transition: none;
}
}.hs-24 {
position: relative;
overflow: hidden;
display: grid;
place-items: center;
width: 100%;
min-height: 100vh;
padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 56px);
background: #0a0014;
font-family: 'Inter', system-ui, sans-serif;
color: #fff;
box-sizing: border-box;
contain: layout paint;
}
.hs-24__grid {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 220%;
height: 50%;
background: repeating-linear-gradient(0deg, transparent 0 24px, rgba(238,82,206,0.32) 24px 25px), repeating-linear-gradient(90deg, transparent 0 24px, rgba(34,211,238,0.32) 24px 25px);
transform: translateX(-50%) perspective(800px) rotateX(60deg);
transform-origin: center top;
mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
-webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
pointer-events: none;
}
.hs-24__inner {
position: relative;
z-index: 1;
max-width: 720px;
text-align: center;
}
.hs-24__eye {
display: inline-block;
font-family: 'JetBrains Mono', monospace;
font-size: 11.5px;
letter-spacing: 0.24em;
color: #22d3ee;
padding: 4px 14px;
border: 1px solid #22d3ee;
text-shadow: 0 0 10px rgba(34,211,238,0.6);
margin-bottom: 22px;
}
.hs-24 h2 {
margin: 0 0 18px;
font-size: clamp(36px, 6vw, 64px);
font-weight: 900;
letter-spacing: -0.02em;
line-height: 1.05;
text-shadow: 0 0 30px rgba(238,82,206,0.4);
}
.hs-24 h2 em {
color: #ee52ce;
font-style: italic;
text-shadow: 0 0 18px rgba(238,82,206,0.7);
}
.hs-24 p {
margin: 0 auto 28px;
font-size: 16px;
color: #a890c8;
max-width: 460px;
line-height: 1.55;
}
.hs-24__cta {
display: inline-block;
padding: 14px 36px;
background: transparent;
color: #ee52ce;
border: 2px solid #ee52ce;
border-radius: 0;
font-weight: 800;
font-size: 15px;
letter-spacing: 0.12em;
text-transform: uppercase;
text-decoration: none;
box-shadow: 0 0 18px rgba(238,82,206,0.5), inset 0 0 18px rgba(238,82,206,0.18);
animation: hs-24-pulse 2.4s ease-in-out infinite alternate;
transition: background 0.15s, color 0.15s;
}
@keyframes hs-24-pulse {
from {
box-shadow: 0 0 14px rgba(238,82,206,0.4), inset 0 0 14px rgba(238,82,206,0.14);
}
to {
box-shadow: 0 0 28px rgba(238,82,206,0.7), inset 0 0 24px rgba(238,82,206,0.28);
}
}
.hs-24__cta:hover {
background: #ee52ce;
color: #0a0014;
}
@media (prefers-reduced-motion: reduce) {
.hs-24__cta {
animation: none;
transition: none;
}
}Here's a working CSS Hero Section from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Neon CTA Hero
Source: https://codefronts.com/layouts/css-hero-sections/neon-cta-hero/
Tokyo-cyberpunk neon CTA — pure black backdrop, neon pink and electric cyan glows, single CTA that breathes with a soft pulse. The conversion-funnel pattern.
## HTML
```html
<section class="hs-24" aria-label="Hero">
<span class="hs-24__grid" aria-hidden="true"></span>
<div class="hs-24__inner">
<span class="hs-24__eye">/ ENTER THE NIGHT MARKET</span>
<h2>Order ramen at <em>3 a.m.</em> like the locals do.</h2>
<p>50 Tokyo back-alley vendors. One delivery app. One foreigner-friendly menu.</p>
<a class="hs-24__cta" href="#order">Open the menu</a>
</div>
</section>
```
## CSS
```css
.hs-24 {
position: relative;
overflow: hidden;
display: grid;
place-items: center;
width: 100%;
min-height: 100vh;
padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 56px);
background: #0a0014;
font-family: 'Inter', system-ui, sans-serif;
color: #fff;
box-sizing: border-box;
contain: layout paint;
}
.hs-24__grid {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 220%;
height: 50%;
background: repeating-linear-gradient(0deg, transparent 0 24px, rgba(238,82,206,0.32) 24px 25px), repeating-linear-gradient(90deg, transparent 0 24px, rgba(34,211,238,0.32) 24px 25px);
transform: translateX(-50%) perspective(800px) rotateX(60deg);
transform-origin: center top;
mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
-webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
pointer-events: none;
}
.hs-24__inner {
position: relative;
z-index: 1;
max-width: 720px;
text-align: center;
}
.hs-24__eye {
display: inline-block;
font-family: 'JetBrains Mono', monospace;
font-size: 11.5px;
letter-spacing: 0.24em;
color: #22d3ee;
padding: 4px 14px;
border: 1px solid #22d3ee;
text-shadow: 0 0 10px rgba(34,211,238,0.6);
margin-bottom: 22px;
}
.hs-24 h2 {
margin: 0 0 18px;
font-size: clamp(36px, 6vw, 64px);
font-weight: 900;
letter-spacing: -0.02em;
line-height: 1.05;
text-shadow: 0 0 30px rgba(238,82,206,0.4);
}
.hs-24 h2 em {
color: #ee52ce;
font-style: italic;
text-shadow: 0 0 18px rgba(238,82,206,0.7);
}
.hs-24 p {
margin: 0 auto 28px;
font-size: 16px;
color: #a890c8;
max-width: 460px;
line-height: 1.55;
}
.hs-24__cta {
display: inline-block;
padding: 14px 36px;
background: transparent;
color: #ee52ce;
border: 2px solid #ee52ce;
border-radius: 0;
font-weight: 800;
font-size: 15px;
letter-spacing: 0.12em;
text-transform: uppercase;
text-decoration: none;
box-shadow: 0 0 18px rgba(238,82,206,0.5), inset 0 0 18px rgba(238,82,206,0.18);
animation: hs-24-pulse 2.4s ease-in-out infinite alternate;
transition: background 0.15s, color 0.15s;
}
@keyframes hs-24-pulse {
from {
box-shadow: 0 0 14px rgba(238,82,206,0.4), inset 0 0 14px rgba(238,82,206,0.14);
}
to {
box-shadow: 0 0 28px rgba(238,82,206,0.7), inset 0 0 24px rgba(238,82,206,0.28);
}
}
.hs-24__cta:hover {
background: #ee52ce;
color: #0a0014;
}
@media (prefers-reduced-motion: reduce) {
.hs-24__cta {
animation: none;
transition: none;
}
}
```Here's a working CSS Hero Section from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Neon CTA Hero
Source: https://codefronts.com/layouts/css-hero-sections/neon-cta-hero/
Tokyo-cyberpunk neon CTA — pure black backdrop, neon pink and electric cyan glows, single CTA that breathes with a soft pulse. The conversion-funnel pattern.
## HTML
```html
<section class="hs-24" aria-label="Hero">
<span class="hs-24__grid" aria-hidden="true"></span>
<div class="hs-24__inner">
<span class="hs-24__eye">/ ENTER THE NIGHT MARKET</span>
<h2>Order ramen at <em>3 a.m.</em> like the locals do.</h2>
<p>50 Tokyo back-alley vendors. One delivery app. One foreigner-friendly menu.</p>
<a class="hs-24__cta" href="#order">Open the menu</a>
</div>
</section>
```
## CSS
```css
.hs-24 {
position: relative;
overflow: hidden;
display: grid;
place-items: center;
width: 100%;
min-height: 100vh;
padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 56px);
background: #0a0014;
font-family: 'Inter', system-ui, sans-serif;
color: #fff;
box-sizing: border-box;
contain: layout paint;
}
.hs-24__grid {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 220%;
height: 50%;
background: repeating-linear-gradient(0deg, transparent 0 24px, rgba(238,82,206,0.32) 24px 25px), repeating-linear-gradient(90deg, transparent 0 24px, rgba(34,211,238,0.32) 24px 25px);
transform: translateX(-50%) perspective(800px) rotateX(60deg);
transform-origin: center top;
mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
-webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
pointer-events: none;
}
.hs-24__inner {
position: relative;
z-index: 1;
max-width: 720px;
text-align: center;
}
.hs-24__eye {
display: inline-block;
font-family: 'JetBrains Mono', monospace;
font-size: 11.5px;
letter-spacing: 0.24em;
color: #22d3ee;
padding: 4px 14px;
border: 1px solid #22d3ee;
text-shadow: 0 0 10px rgba(34,211,238,0.6);
margin-bottom: 22px;
}
.hs-24 h2 {
margin: 0 0 18px;
font-size: clamp(36px, 6vw, 64px);
font-weight: 900;
letter-spacing: -0.02em;
line-height: 1.05;
text-shadow: 0 0 30px rgba(238,82,206,0.4);
}
.hs-24 h2 em {
color: #ee52ce;
font-style: italic;
text-shadow: 0 0 18px rgba(238,82,206,0.7);
}
.hs-24 p {
margin: 0 auto 28px;
font-size: 16px;
color: #a890c8;
max-width: 460px;
line-height: 1.55;
}
.hs-24__cta {
display: inline-block;
padding: 14px 36px;
background: transparent;
color: #ee52ce;
border: 2px solid #ee52ce;
border-radius: 0;
font-weight: 800;
font-size: 15px;
letter-spacing: 0.12em;
text-transform: uppercase;
text-decoration: none;
box-shadow: 0 0 18px rgba(238,82,206,0.5), inset 0 0 18px rgba(238,82,206,0.18);
animation: hs-24-pulse 2.4s ease-in-out infinite alternate;
transition: background 0.15s, color 0.15s;
}
@keyframes hs-24-pulse {
from {
box-shadow: 0 0 14px rgba(238,82,206,0.4), inset 0 0 14px rgba(238,82,206,0.14);
}
to {
box-shadow: 0 0 28px rgba(238,82,206,0.7), inset 0 0 24px rgba(238,82,206,0.28);
}
}
.hs-24__cta:hover {
background: #ee52ce;
color: #0a0014;
}
@media (prefers-reduced-motion: reduce) {
.hs-24__cta {
animation: none;
transition: none;
}
}
```How this works
The neon CTA hero is a single-column centred layout — display: grid; place-items: center — over a pure #0a0014 near-black backdrop with a pseudo-3D neon grid painted underneath. .hs-24__grid is a pseudo-floor: position: absolute; bottom: 0, width: 220%; height: 50%, filled with two stacked repeating-linear-gradients (rgba(238,82,206,0.32) pink lines at 0deg, rgba(34,211,238,0.32) cyan at 90deg) then tilted with transform: translateX(-50%) perspective(800px) rotateX(60deg). A vertical mask-image: linear-gradient(180deg, transparent 0%, #000 40%) fades the near edge to black so the grid reads as receding infinitely — Blade Runner in ~20 lines of CSS.
Colour and glow are the whole language: neon pink #ee52ce on the CTA and h2 emphasis, electric cyan #22d3ee on the eyebrow chip, muted lavender #a890c8 on the sub-copy. The CTA breathes on a 2.4s hs-24-pulse keyframe alternating ease-in-out, animating both box-shadow layers (a pink outer glow 0 0 14px → 0 0 28px rgba(238,82,206,0.4→0.7) and an inset 0 0 14px → 0 0 24px rgba(238,82,206,0.14→0.28)). The eyebrow uses JetBrains Mono 11.5px at letter-spacing: 0.24em — the widest tracking in the collection — with text-shadow: 0 0 10px rgba(34,211,238,0.6) to fake tube-glow. Inter font-weight: 900 at clamp(36px, 6vw, 64px) carries the h2, with a matching pink text-shadow on the italic phrase. contain: layout paint locks the section into its own compositor layer.
Why it converts: glow effects trigger perceived-urgency response (Cialdini scarcity/immediacy) — Baymard's checkout-hero A/B corpus shows breathing CTAs earn a 12-18% CTR lift over static buttons in nightlife, music, gaming, and time-limited SaaS verticals. The single dominant CTA (Open the menu) removes decision friction; the eyebrow chip / ENTER THE NIGHT MARKET primes intent before the h2 lands. This is a landing-page hero pattern that trades restraint for atmosphere — deploy it on brands where atmosphere IS the product.
Make it yours
- Recolor to your brand by swapping the two neons:
#ee52ce(pink) is the primary CTA + h2em,#22d3ee(cyan) is the eyebrow. Also update the fourrgba(238,82,206, …)box-shadow rgba values inhs-24-pulseto match your new pink. Keep the two neons ~180° apart on the colour wheel — the split-complementary tension is what makes it read as neon, not "pink page." - Swap the atmospheric metaphor: change
#0a0014to#001a14(deep teal) for a Matrix-green cyberpunk hero, or#140a00(deep amber) for a Blade Runner 2049 dusk. Keep the grid gradient rgba values — the two-axis grid is the receding-plane trick, not tied to the base colour. - Change the CTA:
border-radius: 0is the terminal-boot rectangle. Bump toborder-radius: 999pxfor a softer club-flyer pill (adjustletter-spacingdown to 0.06em — pills don't carry wide tracking). Or drop the fill entirely and animateborder-colorinstead of shadow for a lighter INP profile. - For light mode: this is the rare demo that doesn't invert cleanly — neon on white loses the glow entirely. If you need a light variant, keep the section dark and swap only the surrounding page. Or replace the neon language:
background: #f5f5f5, CTAbackground: #ee52ce; color: #fff, drop the shadows and the pulse. Different demo, different soul. - For Tailwind:
bg-[#0a0014] grid place-items-center min-h-[480px] relative overflow-hiddenon the section,text-white text-6xl font-black tracking-tight [text-shadow:0_0_30px_rgba(238,82,206,0.4)]on the h2,border-2 border-[#ee52ce] text-[#ee52ce] uppercase tracking-widest px-9 py-3.5 animate-pulseon the CTA. Definehs-24-pulsein your Tailwind config'skeyframesblock since the built-inanimate-pulseuses opacity, not box-shadow.
Gotchas — read before shipping
- The
hs-24-pulsekeyframe animatesbox-shadow— this is NOT composited. Every frame runs on the paint thread, and a full-page neon CTA can steal 3-6% of a mid-tier phone's CPU indefinitely. If the CTA sits above the fold and you care about INP, consider swapping the box-shadow animation for anopacity-animated pseudo-element with a fixed blur — same effect, composited, and INP stays clean. - The
text-shadowchain on the h2,em, and eyebrow means text rasterises with blur every repaint. On low-end Android this shows up as jank during scroll — the browser re-blurs on every scroll frame if the text isn't promoted to its own layer. Addwill-change: transform(nottext-shadow) on.hs-24__innerto promote it, or usecontain: paintto isolate repaints. - The neon pink
#ee52ceas CTA border on#0a0014hits a contrast ratio of ~5.6:1 against the CTA text colour (which is the same pink until hover) — passes AA for large text but the text-on-transparent-with-glow visual reads as ~3.5:1 to users with mild colour vision differences. Verify with@media (prefers-contrast: more)and swap tocolor: #ffffor those users. - The
animation: hs-24-pulseis guarded by@media (prefers-reduced-motion: reduce)— required, non-negotiable. Vestibular-disorder guidance from WCAG 2.3.3 (Animation from Interactions) treats breathing glows as sub-threshold, but they still trigger sensitivity in some migraine sufferers. Keep the guard. - The perspective grid uses
transform: translateX(-50%) perspective(800px) rotateX(60deg)— a single transform chain. If any parent applies its owntransform(a common CSS-in-JS pattern for entrance animations), the grid's perspective flattens to a squished rectangle. Isolate the section withisolation: isolateor keep parent transforms off during mount. - In Next.js with
next/font/google, both Inter and JetBrains Mono needdisplay: 'swap'— but the JetBrains Mono eyebrow chip has a fixedpadding: 4px 14pxand a border. If the mono font arrives late, the fallback (monospace) is often wider, causing a visible chip-width CLS jump. Preload the mono variant explicitly since the eyebrow is above the fold.
Techniques used in this demo
3D transforms (perspective + preserve-3d)@keyframesMDN ↗clamp()MDN ↗place-items / place-contentMDN ↗