Interactive online courses HTML Academy
2026-03-09 10:49 Diff
  • Theory
  • Theory
  • Comments

Color Proportions and Color Stops

By default, colors in gradients are evenly distributed and follow the same proportions, but this behavior can be modified.

This is done using so-called color stops, which are written immediately after the color values, for example, red 0%, yellow 100%.

The color stop indicates the position of the color in the gradient. It can be set as a percentage or in pixels or other units. Let’s take a look at a few examples to understand the behavior of color stops:

yellow, greenyellow 0%, green 100%yellow 0%, green 50%yellow 50%, green 100%yellow 25%, green 75%red, yellow, greenred 0%, yellow 50%, green 100%red 33%, yellow 66%, green 100%

The color stop specifies where the center (most saturated) part of the color will be located.

Comments