Rainbow gradient css Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself. You can display seamless transitions between two or more specified colors using CSS gradients. The following example shows how to create a linear gradient (from left to right) with the color of the rainbow and some text: CSS gradients also support transparency, which can be used to create fading effects. height: 200px; background: linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet, red); But look at it! This gradient is aesthetically horrifying. This works by overlaying 2 gradients, The first is a top-to-bottom gradient with a height of the content. css URL Extension) and we'll pull the CSS from that Pen and include it. It's easy to create a rainbow in CSS using linear-gradient. To add transparency, we use the rgba () function to define the color stops. CSS Gradients. You can choose between three types of gradients: linear (created with the linear-gradient() function), radial (created with the radial-gradient() function), and conic (created with the conic-gradient() function). I decided to adapt the CSS Only Scroll Indicator technique to make a background gradient that canges with scroll position. CSS identifies three different gradient types: Linear Gradients (moves left, right, up, down, diagonally) It's easy to create a rainbow in CSS using linear-gradient. The top right corner of the gradient changes while the bottom right remains the same. You can apply CSS to your Pen from any stylesheet on the web. 0 */ @function rainbow($colors: 7, $start-color: red) { $gradient: "#{$start-color} 0%, #{$start-color} #{(100%/$colors)}"; @for $i from 1 to ($colors + 1) { $angle: (360deg/$colors)*$i; $color: adjust-hue($start-color, $angle); $gradient: $gradient + ", #{$color} #{(100%/$colors)*$i}, #{$color} #{(100%/$colors)*($i+1)}"; } @return $gradient; } body body{margin:0;} #rainbow-background { width:100%; height:100vh; background: linear-gradient(90deg,red, orange, yellow, green, blue, indigo, violet,indigo,blue, green,yellow,orange,red, red); background-size: 1000% 100%; animation: create-rainbow-gradient-shift 30s ease infinite; text-align: center; } @keyframes create-rainbow-gradient-shift{ Scrolling Gradient. You can also link to another Pen here (use the . Users can browse, edit, and copy the hex and CSS code as well as download images and wallpapers of each gradient background. CSS identifies three different gradient types: Linear Gradients (moves left, right, up, down, diagonally). 1 to 6. A curated collection of 24 Rainbow CSS color gradients. This trivial guide is about the use of CSS properties that can be used to define rainbow-like gradient backgrounds for HTML elements. Here is how you can create basic rainbow linear gradient (without integration with text yet): height: 200px; background: red; /* For browsers that do not support gradients */ background: -webkit-linear-gradient(left, orange , yellow, green, cyan, blue, violet); /* For Safari 5.