Tell us what’s happening:
Please I need help, I don’t know why it keeps showing this
“The top edge of the .moon element should be aligned with the top edge of its containing block.”
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Moon Orbit</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<div class="space">
<div class="earth"> </div>
<div class="orbit">
<div class="moon"> </div>
</div>
</div>
</body>
</html>
/* file: styles.css */
.space {
position: relative;
margin: 50% auto;
height: 200px;
width: 200px;
background-color: black;
}
.earth {
background-color: blue;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
width: 100px;
height: 100px;
transform: translate(-50%, -50%);
}
.orbit {
width: 200px;
height: 200px;
position: absolute;
transform: translate(-50%, -50%);
transform-origin: 50% 100%;
animation: orbit 5s linear infinite;
}
.moon {
position: absolute;
width: 30px;
height: 30px;
background-color: gray;
top: 0%;
left: 50%;
transform: translate(-50%);
border-radius: 50%;
}
@keyframes orbit {
0% {
transform: rotate(0deg)
translate(-50%, -50%);
}
100% {
transform: rotate(360deg)
translate(-50%, -50%);
}
}
body {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0
Challenge Information:
Build a Moon Orbit - Build a Moon Orbit