Gradients in CSS

Gradients in CSS smooth color transitions create karte hain do ya zyada colors ke beech.

CSS me 3 types ke gradients hote hain:

  • Linear Gradients
  • Radial Gradients
  • Conic Gradients

Ye background-image property ke andar use hote hain.


Linear Gradients

linear-gradient() ek straight line me color transition create karta hai (top, bottom, left, right ya diagonal).

Syntax

Gradients in CSS (linear-gradient)

Direction Examples

Top to Bottom (default)

Top to Bottom (default)

Bottom to Top

Bottom to Top

Left to Right

Left to Right

Diagonal

Diagonal

Using Angles

Using Angles

0deg = top
90deg = right
180deg = bottom
270deg = left


Multiple Color Stops

Multiple Color Stops

Transparency

Transparency

Repeating Linear Gradient

Repeating Linear Gradient

Radial Gradients

radial-gradient() center se outward color transition banata hai.

Syntax

Radial Gradients

Examples

Evenly spaced colors

Evenly spaced colors

Different spacing

Different spacing

Circle shape

Circle shape

Size Parameter

Size Parameter

Repeating Radial Gradient

Repeating Radial Gradient

Conic Gradients

conic-gradient() me colors center ke around rotate hote hain.

Syntax

Conic Gradients

Example

Gradients in CSS (conic-gradient)

With Degrees

With Degrees

Pie Chart

Pie Chart

From Angle

From Angle

Center Position

Center Position

Gradients in CSS smooth color transitions create karte hain aur designs ko visually attractive banate hain. Linear, radial aur conic gradients use karke different styles aur effects achieve kiye ja sakte hain.

Leave a Comment