We can specify the direction of a
linear gradient using degrees.
The default value of 0 degrees
results in a top to bottom gradient.
We can use positive and negative degree
values to control the orientation.
Let's look at some examples:
In the above example, we applied positive and
negative 45deg
angles to achieve a
diagonal gradient.
The 45deg
creates a diagonal gradient
from bottom left to top right,
while the -45deg
results in a diagonal
gradient from bottom right to top left.