Backgrounds✨ Premium

Holographic Effect

A rainbow gradient (magenta→cyan→yellow→green) scrolls diagonally on loop over a dark background — holographic shimmer in 100% CSS, zero JavaScript.

CSSHolographicRainbow

You'll get access to the interactive demo with a free account.

This effect is part of Effect.Labs — 811 vanilla effects, some free, some premium. Backgrounds has 50 effects, including 6 free. Explore the category →

3 usage examples

Music release teaser — Full-screen background — Holographic Effect example 1

① Music release teaser — Full-screen background

WhenA single or album announcement page opens — minimalist landing, countdown, pre-listen without a press photo.
WhyThe animation covers the full surface with nothing to initialize: the rainbow gradient captures attention and reinforces an electro/pop visual identity without adding any JS dependency.
SettingsDuration 8s by default, smooth. Increase to 14s for a more cinematic feel. Apply a rgba(0,0,0,0.45) scrim on the overlay layer for readable text.
Holographic collector card — Limited-edition badge — Holographic Effect example 2

② Holographic collector card — Limited-edition badge

WhenA card or badge must visually signal rarity — NFT collection, premium loyalty card, in-app reward vignette.
WhyApplied only to the card surface, the effect reproduces the pearlescent shimmer of physical holographic cards. The <code>#0a0a0f</code> base lets the RGBA stops glow without over-saturation.
SettingsDuration 6s for a slightly faster cycle on a small surface. Angle 115deg to accentuate the diagonal. Add border-radius: 16px with overflow: hidden on .bg-holographic — the animation clips cleanly.
Section banner — Tech or design article — Holographic Effect example 3

③ Section banner — Tech or design article

WhenA category header or article byline (AI, design, crypto) needs a strong identity without photography.
WhyThe holographic gradient places the section in an immediately recognizable 'futuristic / premium' register. Pure CSS avoids any external dependency on high-traffic pages.
SettingsDuration 12s for very gentle movement, subtle in a reading context. Fixed height 180px with overflow: hidden. White heading text over a light scrim rgba(0,0,0,0.35).

How it works

The effect relies on a single animated CSS property: background-position. The linear-gradient(125deg, …) is built from five semi-transparent RGBA stops (opacity ~0.45) over a #0a0a0f background — the dark base shows through each color, producing the pearlescent depth characteristic of holographic surfaces.

The gradient is sized at 200% × 200% via background-size: 200% 200%, twice the container in both axes. The @keyframes holographic animation moves the anchor point from 0% 0% to 200% 200% over 8 seconds (linear, infinite loop) — the colored layer scrolls diagonally behind the content.

The stop sequence (rgba(255,0,255)rgba(0,255,255)rgba(255,255,0)rgba(0,255,0)rgba(255,0,255)) closes the cycle: the first and last stops are identical, making the loop perfectly seamless with no visible jump. The 125° angle drives the scroll along a right-descending diagonal — the visual signature of a classic hologram.

Accessibility

  • prefers-reduced-motion: the effect code does not include a @media (prefers-reduced-motion: reduce) rule — add one at integration: @media (prefers-reduced-motion: reduce) { .bg-holographic { animation: none; } }.
  • The effect is purely decorative (a background); overlay content must carry its own role, aria-label, and alt attributes.
  • Apply aria-hidden="true" to the .bg-holographic element if it contains no text — it serves only as a decorative background.
  • Overlay text contrast: the background cycles between deep black and vivid saturated colors — use a scrim (rgba(0,0,0,0.45)) or white text with text-shadow to meet WCAG AA (ratio ≥ 4.5:1).
  • No keyboard interaction or focus management is produced by the effect (passive CSS animation) — no focus-trap risk.

Browser compatibility

Requires @keyframes, background-size, and linear-gradient with RGBA values — supported in all modern browsers since 2016.

Chrome 110+✓ Full
Firefox 110+✓ Full
Safari 16+✓ Full
Edge 110+✓ Full
Mobile iOS✓ Full
Android Chrome✓ Full

Without <code>@keyframes</code> support, the gradient renders statically — holographic colors display without scrolling. No JS error; overlay content remains readable.

The code

HTML structure to paste into your page (CSS + JS available with a premium account):

index.html — structure
<div class="bg-holographic" style="position:relative;min-height:300px;overflow:hidden;">
  <!-- Optional scrim for text readability -->
  <div style="position:absolute;inset:0;background:rgba(0,0,0,0.35);pointer-events:none;" aria-hidden="true"></div>
  <!-- Overlay content -->
  <div style="position:relative;z-index:1;padding:2rem;">
    <h2>Your title</h2>
  </div>
</div>
🔒 Unlock the full code — from €2.99 the first month

Full HTML + CSS + JS, copy-paste ready — with hundreds of premium effects.

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
animation-duration (8s) 8s Duration of one full cycle. Increase (12–20 s) for smooth, subtle movement; decrease (4–6 s) for a pulsed, energetic feel.
RGBA stops in linear-gradient magenta→cyan→yellow→green→magenta Replace the rgba(R,G,B,.45) values to change the palette. Keep the first and last stop identical for a seamless loop.
background-size (200% 200%) 200% 200% Gradient size relative to the container. Increase to 300% or more for a longer scroll and softer color transitions.
Angle 125deg in linear-gradient 125deg Gradient direction. 90deg = straight vertical, 135deg = classic diagonal, 45deg = ascending diagonal.
Alpha values (.45 / .40) 0.45 / 0.40 Per-color opacity over the dark background. Increase toward 0.7–0.9 for vivid, saturated colors; decrease toward 0.2 for a very subtle iridescent wash.
animation-timing-function (linear) linear Replace with ease-in-out for a slow-in/slow-out effect — the gradient 'breathes' rather than scrolling uniformly.

FAQ

Yes — the .bg-holographic class only sets background and animation properties. It works on a <div>, <section>, <button>, or any tag that accepts a CSS background. Add overflow: hidden to keep the animation clipped inside elements with border-radius.
The effect is 100% CSS. To pause: element.style.animationPlayState = 'paused'; to resume: 'running'. To disable globally on a user preference, add @media (prefers-reduced-motion: reduce) { .bg-holographic { animation: none; } } to your stylesheet.
The effect is designed for a dark background (#0a0a0f): semi-transparent RGBA stops blend with black to produce the iridescent look. On a white background, the same stops yield very washed-out pastels — increase the alpha values to 0.7–0.9 and adjust the hues to maintain visual impact.