- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Gradients at an Angle</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="flower">
<div class="leaf leaf-top-left"></div>
<div class="leaf leaf-top-right"></div>
<div class="leaf leaf-bottom-left"></div>
<div class="leaf leaf-bottom-right"></div>
</div>
</body>
</html>
CSS
.leaf-top-left {
background-image: linear-gradient(135deg, #ff0000, #000000);
}
.leaf-top-right {
/*gradient from #00ff00 to #000000*/
}
.leaf-bottom-right {
/*gradient from #ffff00 to #000000*/
}
.leaf-bottom-left {
/*gradient from #ff00ff to #000000*/
}
.leaf-top-left,
.leaf-bottom-right {
border-radius: 0 50%;
}
.leaf-top-right,
.leaf-bottom-left {
border-radius: 50% 0;
}
.leaf {
float: left;
margin: 0;
width: 150px;
height: 150px;
background-color: #dfdfdf;
}
.flower {
margin: 0 auto;
padding-top: 80px;
width: 300px;
}
html,
body {
margin: 0;
height: 100%;
}
You’ve gone to a different page
Goalscompleted
0
Finish coloring the flower using gradients:
- Assign a gradient at an angle of
225°
to the top right leaf. - Assign a gradient at an angle of
315°
to the lower right leaf. - Assign a gradient at an angle of
45°
to the lower left leaf.
The colors for the leaves are indicated in the comments in the CSS.
Comments