Interactive online courses HTML Academy
2026-03-09 14:12 Diff

The directions of the gradient are specified using the keywords: top, bottom, left, right.

The direction of the gradient is specified right before the color list and includes the particle to. It has been added to the syntax to improve readability and clarity:

background-image: linear-gradient(to right, yellow, green);

And we can immediately understand that this means: “Yellow-green gradient from left to right”.

Here are examples of different gradient directions with the colors yellow, green:

to rightto leftto bottomto top

Now practice setting different directions for the gradients yourself.