Collection of free CSS gradient code examples from Codepen and other resources

Browse a collection of free CSS gradient code examples from Codepen and other resources to create beautiful and smooth gradient backgrounds and effects for your website.

CSS Rainbow Gradient Border

Author:
Bramus | January 28, 2021
Made with:
HTML / CSS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
conic-gradient() panels

conic-gradient() panels

Author:
Ana Tudor | April 22, 2020
Made with:
HTML (Pug) / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Gradient Spinner

Author:
Adam Dipinto | September 29, 2019
Made with:
HTML / CSS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
Multiple background-clip

Multiple background-clip

Author:
Chris Coyier | August 17, 2019
Made with:
HTML / CSS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Gradient Ordered List

Author:
Erin E. Sullivan | May 15, 2019
Made with:
HTML / CSS (SCSS)

About a code

A simple, styled ordered list using SCSS and HTML5. The gradient background transitions from one, to another, and back again.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

CSS Gradient Counter List

Author:
Mattia Astorino | March 7, 2019
Made with:
HTML (Pug) / CSS (PostCSS)

About a code

An example of CSS counter with a fixed background gradient.

Compatible browsers:
Chrome, Edge, Opera, Safari
Responsive:
yes
Dependencies:
-
Gradient Collection

Gradient Collection

Author:
Tamino Martinius | August 18, 2018
Made with:
HTML (Pug) / CSS (PostCSS)

About a code

A small collection of CSS gradients.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Scrolling Gradient

Author:
Mike | June 27, 2018
Made with:
HTML / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
Gradient

Gradient

Author:
Ana Tudor | May 21, 2018
Made with:
HTML / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Radial Gradient Spotlight Effect

Author:
George W. Park | May 15, 2018
Made with:
HTML / CSS / JS (Babel)

About a code

This example shows how CSS radial gradients can be used to create a focusable spotlight effect.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
Dithered CSS Gradients

Dithered CSS Gradients

Author:
David J. Aldred | April 25, 2018
Made with:
HTML / CSS (SCSS)

About a code

Mixing noise with CSS gradients helps to remove banding, but results in an overall grainy texture. By overlaying gradients and applying masks the dithering can be controlled to affect the areas where colours blend only. The strength of the dithering is affected by the noise image (the one used here is quite pronounced giving a grainy look, but the effect can be much more subtle).

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Pretty Underline

Author:
Will King | August 15, 2017
Made with:
HTML / CSS (SCSS) / JS (Babel)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
CSS-only Numbered Lists with Drop Shapes

CSS-only Numbered Lists with Drop Shapes

Author:
Ines Montani | August 8, 2017
Made with:
HTML (Pug) / CSS

About a code

Styled numbered list using CSS counters and pseudo elements for drop-shaped backgrounds.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Animated CSS Gradient Border

Author:
Mike Schultz | July 20, 2017
Made with:
HTML / CSS (PostCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Gradient Backgrounds - Linear, Radial, Duotone

Author:
Eric Porter | July 2, 2017
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
font-awesome.css, jquery.js

Animated Back Glow

Author:
George Hastings | January 8, 2017
Made with:
HTML / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

CSS Gradient Hover Effect

Author:
Jon Daiello | August 29, 2016
Made with:
HTML / CSS (SCSS)

About a code

A quick proof of concept for a hover effect utilizing mix-blend-mode and CSS gradients.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Animated Paralax Gradients

Author:
Andrew Spencer | August 4, 2016
Made with:
HTML / CSS (SCSS) / JS

About a code

Playing with gradients, animation, and scroll position to create a dynamic scrolling effect.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
jquery.js

CSS Hue Rotation with Gradient

Author:
Jamie Coulter | June 17, 2016
Made with:
HTML (Haml) / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Button with Gradient Shadow

Author:
Mohsen Khakbiz | May 1, 2016
Made with:
HTML / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Radar

Author:
Jon Kantner | April 29, 2016
Made with:
HTML / CSS (SCSS)

About a code

A radar display made with only one element. To avoid using a child span or div, I drew everything using multiple sets of backgrounds. For the scanning animation though, we needed to use :before for the part to animate.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
Tile with Gradient Title

Tile with Gradient Title

Author:
Fabio Ottaviani | January 25, 2016
Made with:
HTML / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

SVG Text Clip with Gradient & GIF

Author:
CY Park | August 19, 2015
Made with:
HTML / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
Gradient Forest on Pure CSS

Gradient Forest on Pure CSS

Author:
DonSinDRom | November 12, 2014
Made with:
HTML (Pug) / CSS (Stylus)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

CSS Sunset Sunrise

Author:
Marty | October 19, 2014
Made with:
HTML / CSS / JS

About a code

Move the sun around with your mouse.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-
Gradients

Gradients

Author:
emma | April 24, 2014
Made with:
HTML / CSS (SCSS)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Sky Gradients

Author:
zessx | October 19, 2013
Made with:
HTML (Haml) / CSS (SCSS)

About a code

24 CSS3 sky gradients for a future experiment. Click on to get a full width preview.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Brushed Metal

Author:
simurai | April 22, 2013
Made with:
HTML / CSS

About a code

The texture is done by using 3 repeating-gradients with different length.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
CSS3 Patterns Gallery

CSS3 Patterns Gallery

Author:
Lea Verou | June 19, 2011
Made with:
HTML / CSS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Discover Our Extensive Snippet Library

This heading suggests that your website provides a wide variety of snippets across different technologies, encouraging users to explore and use these resources for their development projects.

HTML Snippets.

Explore a collection of HTML snippets designed to streamline your web development process. From basic structures to complex elements.

CSS Snippets.

Discover powerful CSS snippets that help you style your web pages with ease. Whether you need layout solutions, animations

JavaScript Snippets.

Enhance your website's interactivity with our JavaScript snippets. From DOM manipulation to advanced algorithms

Bootstrap Snippets.

Leverage the power of Bootstrap with our collection of snippets. Quickly integrate responsive design components

Tailwind Snippets.

Speed up your development process with Tailwind CSS snippets. These utility-first CSS snippets enable you to

jQuery Snippets.

Simplify your JavaScript development with jQuery snippets. Easily perform common tasks like event handling, animations

React Snippets.

Build robust, component-based user interfaces with our React snippets. From state management to lifecycle methods,

Vue Snippets.

Streamline Vue.js development with our collection of snippets for creating components, managing state, and handling events.

Ready to set your Brand ablaze?

Let's craft a visual identity that ignites passion and loyalty. ✨