CSS Part 5
CSS Part 5
CSS gradients let you display smooth transitions between two or more specified
colors
CSS defines two types of gradients:
Linear Gradients (goes down/up/left/right/diagonally)
Radial Gradients (defined by their center)
IE9 and earlier versions do not support gradients
Left to right
#grad2 {
background: linear-gradient(to right, blue,
lightblue);
}
Diagonal
#grad3 {
background: linear-gradient(to bottom right,
blue, lightblue);
}
The angle is specified as an angle between a horizontal line and the gradient line
#grad4 {
background: linear-gradient(30deg, yellow, red);
}
<div id="grad6">
Gradient Background
</div>