codegurukool.com · Free coding tutorials & online compiler

Home › CSS Tutorial › CSS gradients

CSS gradients

Smooth color transitions.

linear-gradient, radial-gradient and conic-gradient create images from colors.

Example code

<style>
div{height:60px;margin:6px;color:#fff;padding:6px}
</style>
<div style='background:linear-gradient(90deg,#e4572e,#ffc857)'>Linear</div>
<div style='background:radial-gradient(circle,#2e86de,#14213d)'>Radial</div>
<div style='background:conic-gradient(#e4572e,#ffc857,#1b998b,#e4572e)'>Conic</div>

Run this code in the online editor

← CSS math functionsCSS shadows →