In CSS, gradients are a way to create a smooth transition between two or more colors, allowing you to apply colorful and visually appealing backgrounds to HTML elements. CSS provides two main types of gradients: linear gradients and radial gradients.