DistortionPremium

VHS Effect

A grid of thin dark lines that keeps scrolling over a block, with light grain: the image or title you place underneath looks like a tape being played back.

CSSRetroNoise

Updated

This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Distortion has 31 effects, including 5 free. Explore the category →

3 usage examples

Featured thumbnail in a video archive — VHS Effect example 1

① Featured thumbnail in a video archive

WhenOn the home page of a local-news video archive, the featured tape ("The harbour festival", 1987) carries the VHS lines over its picture; the secondary thumbnails stay clean.
WhyThe lines say "old video tape" at a glance without spoiling the picture: they set the featured item apart and match the subject, reports digitised from their original cassettes.
Settings--vhsl-w: 100% in a 290×168 px frame, --vhsl-root-h: 0, --vhsl-page: transparent; the picture is an SVG placed as .vhsl-media under the lines; "PLAY ▶" label bottom left (margin added by the scene).
Pause screen of a cooking-class video player — VHS Effect example 2

② Pause screen of a cooking-class video player

WhenDuring a pastry lesson, a click on the picture pauses the video: the effect's root then shows over the whole picture, with "PAUSE ❚❚" in the middle; the button below resumes playback.
WhyThe frozen picture under the lines recalls a paused VCR: the paused state reads instantly, without hiding the step the student wants to look at again.
SettingsRoot in position: absolute; inset: 0 over the player, --vhsl-w: 100%, --vhsl-h: 100%, --vhsl-bg: rgba(8,10,28,.42) to dim the picture, --vhsl-size: 30px. The click only shows the root (scene wiring); the effect itself listens to nothing.
"RERUN" tag in a local TV channel's schedule — VHS Effect example 3

③ "RERUN" tag in a local TV channel's schedule

WhenIn the evening schedule, only one show is a rerun: its 96×32 px tag carries the scrolling lines next to the title; the other rows have nothing or a plain "Live" tag.
WhyAt small size the lines become a sign: "already aired, out of the archive". The tag stands out because it barely moves inside an otherwise still list.
Settings--vhsl-w: 96px, --vhsl-h: 32px, --vhsl-size: 12px, --vhsl-line: rgba(0,0,0,.55) for stronger lines, --vhsl-bg as an indigo gradient; root set to width: auto to fit in the row.

How it works

Everything happens in .vhsl-screen, a 300×200 px block by default. Its ::before pseudo-element paints a repeating-linear-gradient: 2 px transparent, 2 px of 30 % black, over and over. The vhslScan animation shifts that pattern by 4 px every 0.1 s, endlessly, so the lines seem to slide down like a VCR reading a tape.

On top, .vhsl-noise lays an SVG fractal noise (written as a data: URL inside the CSS, no file to load) at 5 % opacity in overlay mode, and ::after adds an almost invisible light band: a 3 % white gradient whose opacity swings between 3 and 5 %, barely 0.15 % white at its peak. Both layers stay subtle: what you notice first is the line grid. There is no colour shift and no frame jump.

The .vhsl-label text ("PLAY ▶") sits above the lines. An <img class="vhsl-media"> or <video class="vhsl-media"> placed in the screen fills it, under the lines. No JavaScript: it is all CSS, tuned with variables (--vhsl-w, --vhsl-h, --vhsl-bg…).

Accessibility

  • Nothing to operate: the effect reacts to neither mouse nor keyboard and adds no focusable element. Any play buttons stay yours.
  • Readable text: "PLAY" is real text; the ▶ triangle has aria-hidden="true" so it is not read out as "black right-pointing triangle".
  • Reduced motion: under prefers-reduced-motion: reduce, the lines stop scrolling and the light band stops pulsing; the lines stay on screen, still.
  • No flashing: the pulsing band never goes above 5 % opacity and the measured average luminance stays flat. On a bright image, still check the contrast of the white label.

Browser compatibility

CSS only, no external resource (the grain is an SVG written inside the CSS). The most recent property is inset (Chrome 87, Firefox 66, Safari 14.1 according to MDN data). Measured in Chromium 151, Firefox 153 and WebKit 26.5: same rendering, two independent copies, nothing added to window, fluid width at 100 %.

Chrome 87+✓ Full (measured)
Firefox 66+✓ Full (measured)
Safari 14.1+✓ Full (measured in WebKit)
Edge 87+✓ Full
Mobile iOS 14.5+✓ Full
Android Chrome 87+✓ Full

Without inset support, the lines and grain no longer cover the screen: the block and its label still show, without the effect. Without mix-blend-mode, the grain simply shows at 5 % opacity.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0252-root">
  <div class="vhsl-screen">
    <div class="vhsl-noise" aria-hidden="true"></div>
    <span class="vhsl-label">PLAY <span aria-hidden="true">▶</span></span>
  </div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Screen size (CSS — --vhsl-w, --vhsl-h) 300 px × 200 px 100% fills the parent (with max-width: 100%, the screen never overflows). A 96×32 px tag still shows readable lines.
Screen background (CSS — --vhsl-bg) Gradient #1a1a2e → #16213e Any background value: colour, gradient, url(). A semi-transparent colour dims whatever lies behind the root.
Image or video under the lines (HTML — vhsl-media class) None Put <img class="vhsl-media"> or <video class="vhsl-media"> inside .vhsl-screen: the media covers the screen (object-fit: cover) and sits under the lines and grain.
Line colour (CSS — --vhsl-line) rgba(0, 0, 0, .3) Go up to .5 for crisp lines over a bright image; a colour (blue, green) tints the grid.
Label (HTML — .vhsl-label, CSS — --vhsl-color, --vhsl-size) "PLAY ▶", white, 1.5rem, bold Change the text (PAUSE, REC, a running time); remove the span for lines without text.
Scroll speed (CSS — vhslScan duration in .vhsl-screen::before) 0.1 s per 4 px 0.3 s gives a slow, calm scroll; above 1 s the lines look almost still.
Surrounding frame (CSS — --vhsl-page, --vhsl-root-h) #0a0a0f, at least 300 px tall transparent and 0 drop the screen into your layout without the dark demo frame.

FAQ

No. The code draws a scrolling line grid, a very light still grain and a barely visible light band. No red/blue doubling, no vertical jump. It is a restrained effect that keeps the picture readable.
Yes: a <video class="vhsl-media" autoplay muted loop playsinline> tag inside .vhsl-screen fills the frame under the lines. The video keeps its own controls and its own motion setting: the lines do not replace them.
No. With prefers-reduced-motion: reduce, the scrolling and the light-band pulse stop; the lines stay visible, still, and the label does not change.