Build a House Painting - Build a House Painting

Tell us what’s happening:

#chimney is not showing on rooftop, I have tried changing the z-index but still the problem is there.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styles.css">
    <title>House Painting</title>
</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 */
#house{
  position:relative;
  width:500px;
  height:400px;
  background-color:darkorange;
  border:2px solid black;
}
#house div{
  position:absolute;
}
#chimney{
 width:100px;
 height:300px;
 background-color:green;
 border:2px solid black;
 top:0;
 right:0px;
 z-index:-1;
 
}
#roof{
  width:100%;
  height:100px;
  background-color:yellow;
  border:2px solid black;
  top:0;
  left:0;


}

#window-1{
  width:100px;
  height:100px;
  background-color:gray;
  border:2px solid black;
  top:35%;
  left:10%;
}
#window-2{
  width:100px;
  height:100px;
  background-color:gray;
  border:2px solid black;
  top:35%;
  right:10%;
}
#door{
  width:120px;
  height:180px;
  background-color:gray;
  border:2px solid black;
  bottom:0%;
  left:38%;
}

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36

Challenge Information:

Build a House Painting - Build a House Painting

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-house-painting/66d6a7a3e1aa411e94bf2346.md at main · freeCodeCamp/freeCodeCamp · GitHub

consider what you would need to change these to to move the chimney above the house

Welcome back @Kelvin12,

Isn’t the top of the house at 0 since everything is positioned relative to the house? So, if the height of your chimney is 300px, what would top need to be to position the base of the chimney at the top of the house?

Happy coding

I

When I use (top: -10px ) it works. But the system demands I use (top:0)

I tried using (top:-10px) but the system demands I use (top:0)

How/where is the system demanding a specific 0 value for top?

It does not accept the (top=-10px)

That’s not what I asked. It doesn’t accept top=-10px because that is not the correct setting for the chimney top position.

the chimney need to be positioned above the house, so that it’s bottom border matches the house top border

you need to look at one of the other chimney properties to know what is the right top value to use here