Tell us what’s happening:
Hello everyone, I’m having trouble with #40. Your #chimney should have a top value that places it at the top of your #house.
#chimney {
width: 50px;
height: 80px;
border: 2px solid #000;
background-color: green;
top: -50px;
left: 350px;
z-index: -1;
}
I previously looked on the forum and they said I had to change the value from % to px, but I did that and it still failed.
Your code so far
<!-- file: index.html -->
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>House Structure</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="house">
<div id="chimney"></div>
<div id="roof"></div>
<div id="window-1"></div>
<div id="window-2"></div>
<div id="door"></div>
</div>
</body>
</html>
/* file: styles.css */
body{
background-color: #F0FFFF;
display: flex;
margin-left: 100px;
margin-top: 100px;
}
#house {
position: relative;
width: 500px;
height: 400px;
background-color: #5e5e5e;
border: 3px solid #000;
}
#house div {
position: absolute;
}
#chimney {
width: 50px;
height: 80px;
border: 2px solid #000;
background-color: green;
top: -50px;
left: 350px;
z-index: -1;
}
#roof {
width: 100%;
height: 100px;
border: 2px solid #000;
background-color: red;
top: 0;
left: 0;
z-index: 1;
}
#door {
width: 60px;
height: 120px;
border: 2px solid #000;
background-color: brown;
bottom: 0;
left: 220px;
right: 220px;
z-index: 1;
}
#window-1, #window-2 {
width: 60px;
height: 60px;
border: 2px solid #000;
background-color: #87ceeb;
top: 130px;
z-index: 1;
}
#window-1 { left: 80px; }
#window-2 { right: 80px; }
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36
Challenge Information:
Build a House Painting - Build a House Painting
https://www.freecodecamp.org/learn/full-stack-developer/lab-house-painting/build-a-house-painting