<gradient>
The <gradient> CSS data type is a special type of <image> that consists of a progressive transition between two or more colors.
Syntax
The <gradient> data type is defined with one of the function types listed below.
Linear gradient
Linear gradients transition colors progressively along an imaginary line. They are generated with the linear-gradient() function.
Formal Syntax
Values
-
<side-or-corner>The position of the gradient line's starting point. If specified, it consists of the wordtoand up to two keywords: one indicates the horizontal side (leftorright), and the other the vertical side (toporbottom). The order of the side keywords does not matter. If unspecified, it defaults toto bottom.
The valuesto top,to bottom,to left, andto rightare equivalent to the angles0deg,180deg,270deg, and90deg, respectively. The other values are translated into an angle. -
<angle>The gradient line's angle of direction. A value of0degis equivalent toto top; increasing values rotate clockwise from there. -
<color-stop>A color-stop's<color>value, followed by at most one optional stop position, a<percentage>or<number>value along the gradient's axis. Note that unlike the Web standard, Lynx does not support multiple positions after a single color. If a unitless<number>is used, it is treated as a percentage by multiplying it by 100 (e.g.,0.5is treated as50%). Color stops without an explicit position are distributed linearly between known positions.
Radial Gradient
Radial gradients transition colors progressively from a center point (origin). They are generated with the radial-gradient() function.
Formal Syntax
Values
-
<position>The position of the gradient, interpreted in the same way asbackground-positionortransform-origin. If unspecified, it defaults to center. -
<ending-shape>The gradient's ending-shape. The value can becircle(meaning that the gradient's shape is a circle with a constant radius) orellipse(meaning that the shape is an axis-aligned ellipse). If unspecified, it defaults toellipse. -
<size>Determines the size of the gradient's ending shape.
If omitted it defaults to farthest-corner. It can be given explicitly or by keyword. For the purpose of the keyword definitions, consider the gradient box edges as extending infinitely in both directions, rather than being finite line segments. -
<color-stop>Same aslinear-gradient
Conic Gradient
Conic gradients transition colors progressively around a center point (origin). They are generated with the conic-gradient() function.
Formal Syntax
Values
-
<angle>The starting angle of the gradient, preceded by the keywordfrom. The default value is0deg. Supported units includedeg,grad,rad, andturn. Unitless numbers are only accepted if the value is0or if theenable_transform_legacycompatibility mode is enabled. -
<position>The center point of the gradient, preceded by the keywordat. The default value is50% 50%(center). It supports one or two values, using the same syntax asbackground-position:- Keywords:
left,center,right,top,bottom. - Length or percentage:
<length-percentage>(e.g.,20px,30%).
- Keywords:
-
<color-stop-list>A comma-separated list of at least two color stops. Each color stop consists of a<color>followed by at most one optional position (<percentage>or<number>). Note that unlike the Web standard, Lynx does not support multiple positions after a single color. If a unitless<number>is used, it is treated as a percentage by multiplying it by 100 (e.g.,0.5is treated as50%). Color stops without an explicit position are distributed linearly between known positions.
Compatibility
LCD tables only load in the browser