Skip to content

Animated diagonal lines background

Diagonal stripes scroll continuously behind a section, made of repeating CSS gradients, with a fade behind the text.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

Two layers of 45-degree stripes slowly slide behind the section: wide tone-on-tone bands and thin coloured lines moving slightly faster, which adds a hint of depth. The pattern fades gently in the middle, behind the heading and text, to stay subtle: a graphic background for a sign maker, a printer, an architecture studio, a climbing gym or a building works notice. The text keeps AA contrast on the stripes, in light and dark mode. Everything is set with variables: --efdg-band-a and --efdg-band-b for the two band tones, --efdg-line for the thin lines, --efdg-accent for the button. Only the background position is animated, in a seamless loop, with no image or script, and the decoration is hidden from screen readers. A keyboard-accessible checkbox pauses the animation (WCAG 2.2.2). No horizontal scrolling from 360 px. With prefers-reduced-motion the stripes stay visible but still.

Code

Loading the code…

The code of this component in

Archive contents

effet-fond-lignes-diagonales-animees-html-tailwind.zip3 files · 4 Ko

  • index.html4 Ko
  • README.md4 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • Cards that fade in as they enter the screen, one after another in each row, without a line of JavaScript and with a static fallback.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A translucent card with a saturated blur whose sharper edge refracts the colourful shapes drifting behind it, with an opaque fallback when transparency is reduced.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A help block shaped like a conversation: bubbles, three animated typing dots and clickable quick replies that show your answers to frequent questions, frozen under prefers-reduced-motion.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component