← Return to Learn Hub
Educational Guide

Creating Retro CRT Scanlines & Phosphor Glow with Pure CSS

By Keshav Kumar • CSS Graphics & Retro Shader Emulation ‪ 7 min read • Last updated: November 2026

Vintage computer displays from the 1980s possessed a unique visual charm: horizontal raster scanlines, soft phosphor bloom, and subtle screen curvature. Here is how to recreate this aesthetic using pure modern CSS without degrading rendering performance.

The Physics of Vintage Cathode-Ray Tube (CRT) Displays

Unlike modern Liquid Crystal Displays (LCDs) and Organic LEDs (OLEDs) where millions of individual subpixels illuminate instantly, vintage CRT monitors utilized an electron gun firing modulated beams across a vacuum tube coated with phosphorescent material.

As the electron beam sweeps horizontally across the screen, it leaves distinct black gaps between raster passes—creating the signature scanline pattern. Furthermore, excited phosphors continue glowing for several milliseconds after impact, producing the iconic phosphor trail and bloom.

Technique 1: Repeating Linear Gradients for Raster Scanlines

The most performant method to render scanlines in CSS is applying a semi-transparent repeating linear gradient over a pseudo-element (::before or ::after). This technique requires zero DOM nodes and executes directly on the browser's GPU compositor:

.crt-screen::before {
    content: " ";
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.45) 50%
    );
    background-size: 100% 4px;
    z-index: 100;
    pointer-events: none; /* Allows clicks to pass through */
}

Technique 2: Realistic Phosphor Bloom with Layered Text-Shadows

To simulate glowing phosphor characters, avoid generic single-layer blur effects. Natural light diffusion follows an inverse-square falloff curve. We emulate this by layering multiple text-shadow passes with expanding radii and varying opacities:

.phosphor-green {
    color: #ffffff; /* White core */
    text-shadow:
        0 0 2px #00ff88,
        0 0 6px #00ff88,
        0 0 14px rgba(0, 255, 136, 0.6),
        0 0 28px rgba(0, 255, 136, 0.3);
}

Technique 3: Spherical Barrel Distortion (Screen Curvature)

Vintage monitor glass was physically convex. While heavy WebGL shaders can compute true barrel distortion, pure CSS can simulate corner vignetting and edge curvature using a radial gradient overlay:

.crt-screen::after {
    content: " ";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(
        circle at center,
        transparent 60%,
        rgba(0, 0, 0, 0.75) 100%
    );
    pointer-events: none;
}

Accessibility: Honoring prefers-reduced-motion

Simulating 60Hz cathode flicker or horizontal roll can trigger ocular strain or photosensitive disorientation in sensitive users. Always respect operating system accessibility settings with a media query:

@media (prefers-reduced-motion: reduce) {
    .crt-flicker {
        animation: none !important;
        opacity: 1 !important;
    }
}

CRT Electron Gun Rasterization & Aperture Grille Phosphor Simulation

HORIZONTAL SCANLINES repeating-linear-gradient( 0deg, rgba(0,0,0,0.3) 0px, transparent 1px, transparent 2px ) 0% CPU / Pure GPU Texture PHOSPHOR BLOOM text-shadow: 0 0 5px #00ff88, 0 0 15px rgba(0,255,136,0.6); filter: contrast(1.15); Emulates P1 Phosphor Glow VIGNETTE CURVATURE radial-gradient(circle, transparent 60%, rgba(0,0,0,0.8) 100%) pointer-events: none; Curved Glass Screen Illusion

Authoritative References & Technical Sources

View Matrix CRT Terminal

See phosphor decay trails and scanline palettes in action on our Matrix code rain terminal simulator.

Launch Simulator →