background-image: linear-gradient(to right, rgba(255,0,0,0), rgba(255,0,0,1)); } Linear Gradient - Transparency To add transparency, we use the rgba() function to define the color stops. The last parameter in the rgba() function can be a value from 0 to 1, and it ...
A linear gradient changes color along a linear pattern (horizontally/vertically/diagonally).The createLinearGradient() method has the following parameters:ParameterDescription x0 Required. The x-coordinate of the start point y0 Required. The y-coordinate of the start point x1 Required. The x-...
An ellipse with a horizontal linear gradient that goes from yellow to green to red:Sorry, your browser does not support inline SVG. Here is the SVG code:Example <svg height="150" width="400" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="grad2" x1="0%" x2="...
The CSS repeating-linear-gradient() function is used to repeat linear gradients.Example:Linear GradientRepeating Linear Gradient linear-gradient(red, yellow, blue); repeating-linear-gradient(red, yellow 10%, blue 20%);Version: CSS Images Module Level 3...