About Lesson
1. Conic Gradients:
Syntax:
background: conic-gradient(from angle at position, color-stop1, color-stop2, ...);
angle
(optional): Defines the starting angle of the gradient.position
(optional): Defines the position of the gradient center. Defaults tocenter
.color-stop
: Similar to linear and radial gradients.
Example:
.conic-gradient
: Applies a conic gradient background starting from 0 degrees with colors #ff00cc
and #333399
.
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>
.conic-gradient {
background: conic-gradient(from 0deg, #ff00cc, #333399, #ff00cc);
width: 200px;
height: 200px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body>
<div class="conic-gradient"></div>
</body>
</html>