About Lesson
1. Radial Gradients:
Syntax:
background: radial-gradient(shape size at position, color-stop1, color-stop2, ...);
shape
(optional): Defines the shape of the gradient. Can becircle
orellipse
.size
(optional): Defines the size of the gradient. Can be keywords likeclosest-side
,farthest-corner
, etc.position
(optional): Defines the position of the gradient center. Defaults tocenter
.color-stop
: Similar to linear gradients.
Example:
.radial-gradient
: Applies a radial gradient background from #00c6ff
to #0072ff
.
CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Gradients Example</title>
<style>
.radial-gradient {
background: radial-gradient(circle, #00c6ff, #0072ff);
width: 200px;
height: 200px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body>
<div class="radial-gradient"></div>
</body>
</html>