moon class pseudo-element
Lesson 8 of 10 in Coddy's Solar Eclipse Animation | HTML/CSS Project course.
Challenge
EasyIn the CSS file, target the moon class and use ::before pseudo-element,
- Set the content of this element to
""(Empty string). - Set the background-color to
rgba(0, 0, 0, 0). - Set the border-radius of
50%. - Set the z-index of
-1. - Set the width and height to
100%. - Set the position to
absoluteand set display toblock. - Add animation named
"eclipse-animation", which will run over every3.2sinlinear,infiniteandalternatestate.
Try it yourself
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Write HTML code here -->
<script src="script.js"></script>
</body>
</html>