Creating Linear Gradients using Multiple Color Stops in CSS

CSSWeb DevelopmentFront End Technology

To create a linear gradient using multiple color stops, the code is as follows −

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<style>
body {
   font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
div {
   height: 200px;
   width: 100%;
   display: inline-block;
   margin-right: 10px;
}
.linearGradient {
   background-image: linear-gradient(to left, orange, blue,green,pink,yellow);
}
</style>
</head>
<body>
<h1>Linear Gradient direction using multiple color stops</h1>
<div class="linearGradient"></div>
</body>
</html>

Output

The above code will produce the following output −

raja
Published on 11-May-2020 13:08:42
Advertisements