Tell us what’s happening:
Hello, I want to ask about position absolute and relative. I have tried to change the position on line 10 to be absolute, but I found that the box was shifting a little bit top and left eventhough the properties for the top and left are still the same at the relative position. Can somebody please tell me why was that?
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>fCC Cat Painting</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<main>
<div class="cat-head"></div>
</main>
</body>
</html>
/* file: styles.css */
* {
box-sizing: border-box;
}
body {
background-color: #c9d2fc;
}
.cat-head {
/* User Editable Region */
position: relative;
top: 100px;
left: 100px;
/* User Editable Region */
background: linear-gradient(#5e5e5e 85%, #45454f 100%);
width: 205px;
height: 180px;
border: 1px solid #000;
border-radius: 46%;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Challenge: Learn Intermediate CSS by Building a Cat Painting - Step 11
Link to the challenge: