Specifying Gradients

There is just one more thing we need to look at before our look into working with colors is wrapped up. That thing is gradients! So far, we’ve only specified a single color value for the various things we’ve been coloring. Gradients change all that. With gradients, you have the ability to specify multiple colors and how those colors blend in with each other. In the following sections, let’s learn all about them.

The Linear Gradient

The first gradient variation we’ll learn about is the linear one. A linear gradient is one where you have two or more colors on a virtual (invisible) straight line. These colors blend evenly as you move from one color to another on this line. That definition is probably more complicated than it needs to be, but hopefully the following image makes more sense:

Get hands-on with 1200+ tech skills courses.