- Home
- /
- Tutorials
- /
- CSS Tutorial
- /
- CSS Gradients
CSS Effects
CSS Gradients
CSS Gradients are used to create smooth transitions between two or more colors without using images.
Gradients are commonly used for:
- Website backgrounds
- Buttons
- Cards
- Hero sections
- Modern UI designs
Because gradients are generated by CSS, they load faster than image-based backgrounds and scale perfectly on all screen sizes. The supporting concepts are explained in CSS Colors and Modern Colors.
CSS provides two main gradient types:
- Linear Gradient
- Radial Gradient
Syntax
Linear Gradient
Linear Gradient Syntax
css
selector {
background: linear-gradient(color1, color2);
}