Collection of hand-picked free HTML and CSS animated background code examples from Codepen, Github and other resources. Update of April 2021 collection. 9 new items.

Related Articles

  1. JavaScript Background Effects
  2. jQuery Background Plugins

Author

  • Temani Afif

Made with

  • HTML / CSS

About a code

CSS Only Pattern Animation

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Bárbara Rodríguez

Made with

  • HTML / CSS

About a code

Gradient Background with Waves

Gradient background with some waves on the bottom of the page. If you want a different background for you website or app this is a simple way.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Wil van der Tuin

Made with

  • HTML / CSS (SCSS)

About a code

Blurred Animated Gradients

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Diyorbek Olimov

Made with

  • HTML / CSS

About a code

Bubble Background Animation

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Temani Afif

Made with

  • HTML / CSS

About a code

Hexagon Background with 0 HTML

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Ryan Mulligan

Made with

  • HTML / CSS

About a code

CSS linear-gradient Animations

Animating a stack of linear-gradients.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Alison Quaglia

Made with

  • HTML / CSS (SCSS)

About a code

Floating Color Orbs

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • alphardex

Made with

  • HTML / CSS (SCSS)

About a code

Shooting Star

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • alphardex

Made with

  • HTML / CSS (SCSS)

About a code

Bubble Float

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Casthra Demosthene

Made with

  • HTML / CSS

About a code

Falling Leaves CSS Animation

October falling leaves CSS animation CSS no JavaScript.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Mathieu S.

Made with

  • HTML / CSS

About a code

Noise Background

CSS only animated static noise background.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Adam Abundis

Made with

  • HTML / CSS

About a code

Pattern Animation (Infinite)

Used Flexbox to vertically and horizontally center text. Used keyframes to set an infinite scroll.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Yusuke Nakaya

Made with

  • HTML (Pug) / CSS (SCSS)

About a code

Only CSS: Warning

Stripe background.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Igor Milenkovic

Made with

  • HTML / CSS (Less)

About a code

Cool Mountain Background

Cool mountain background with animations - slightly responsive.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Vaibhav Arora

Made with

  • HTML (Haml) / CSS

About the code

Animated Ripples Background

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -

Author

  • Rob DiMarzo

Made with

  • HTML (Pug) / CSS (SCSS)

About the code

Infinite SVG Triangle Fusion

Triangles are created. Triangles are destroyed.
And so on and so forth. I am creating 60 SVGs that each contain 4 triangles (polygons). Each polygon loops through a color and animates outward from the center point of its parent SVG every 1 second. The entire animation repeats infinitely every 4 seconds.
Each div has a clip-path to create a hexagon mask. When the hexagons are snapped together, the expanding triangles bleed evenly into the triangles of the adjacent hexagons until they disappear.
I used CSS Grid as a starting point, but I was still left with a bunch of well-mannered hexagons with empty space in between. To "connect" the hexagons, I identified the nth-children that corresponds to a row and moved them up and over via transform: translate;

Compatible browsers: Chrome, Firefox, Opera, Safari

Dependencies: -

Author

  • Ksenia Kondrashova

Made with

  • HTML / CSS

About a code

2kb Total Size SVG Animation

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Chris Neale

Made with

  • HTML / CSS (SCSS) / JavaScript (Babel)

About the code

Animated CSS Mask-Image Gradient

Compatible browsers: Chrome, Firefox, Opera, Safari

Dependencies: -

Author

  • Mike Golus

Made with

  • HTML (Pug) / CSS (Sass)

About the code

CSS Fireflies

An elegant HTML/CSS only solution for adding a tranquil fireflies effect to you page.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -

Author

  • Takeshi Kano

Made with

  • HTML (Pug) / CSS (SCSS)

About a code

Pure CSS Particle Animation

CSS particle animation without JavaScript. The most important point is random movement of particles. The vignetting was created by mask-image property.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Anastasia Goodwin

Made with

  • HTML / CSS (SCSS)

About the code

Pure CSS Twinkling Stars Background

Subtle twinkling stars and moving clouds animation using only CSS.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -

Author

  • osorina irina

Made with

  • HTML / CSS (Sass)

About the code

Background Effect

HTML and CSS background effect.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -

Author

  • Mohammad Abdul Mohaiman

Made with

  • HTML / CSS

About the code

Pure CSS Animated Background

Pure CSS animated background.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -

Author

  • Chris Smith

Made with

  • HTML / CSS

About the code

Sliding Diagonals Background Effect

An animated background under the content.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -

Author

  • Bjorn

Made with

  • HTML (Pug) / CSS (SCSS)

About the code

Background Animation

HTML and CSS background animation.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -

Author

  • Rune Sejer Hoffmann

Made with

  • HTML / CSS (SCSS)

About a code

Floating SVGS

Just a simple case study, with SCSS, showing a example on how to achieve some kind of 3D effect using blur and perspective.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Demo image: Animated Background

Author

  • Chandan Choudhary

Made with

  • HTML / CSS

About the code

Animated Background

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -

Author

  • Manuel Pinto

Made with

  • HTML / CSS

About the code

Pure CSS3 Gradient Background Animation

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -

Author

  • Sépion

Made with

  • HTML / CSS

About the code

CSS Background Animation

Example of background animation using CSS.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -

Author

  • user

Made with

  • HTML / CSS

About a code

Retro-Futuristic Grid Background in CSS

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • Nate Wiley

Made with

  • HTML (Haml) / CSS (SCSS)

About a code

ColorDrops

Tryin to create a canvas-like trail effect in CSS using gradients.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies: -

Author

  • kootoopas

Made with

  • CSS (SCSS)

About the code

Infinite Background Animation

Pure CSS infinite background animation.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Dependencies: -