Build a House Painting - Build a House Painting

Tell us what’s happening:

During the build of house project i have tried different approaches and searched for different solutions but nothing is working . Everytime I submit for checks it shows error . please review my code if possible and guide me completing the project. the error is on the chimney part as its showing the top value isn’t right i guess. but i have checked for it multiple times and i am sure about the values.

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">
    <title>House Painting</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{
  width: 100%;
  height: 80%;
  padding-top: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#house{
  position: relative;
  width: 500px;
  height: 400px;
  background-color: crimson;
  border: 9px solid purple;
  border-radius: 9px; 
}

#house div{
  position: absolute;
}

#chimney{
  width: 60px;
  height: 80px;
  background-color: purple;
  border: 2px solid goldenrod;
  top: -90px; right: 100px;
  z-index: -1;
}

#roof{
  width: 100%;
  height: 80px;
  background-color: brown;
  border: 2px solid white;
  top:0;
}

#window-1{
  width: 80px;
  height: 100px;
  background-color: yellow;
  border: 6px solid brown;
  top: 130px;
  left:60px;
}

#window-2{
  width: 80px;
  height: 100px;
  background-color: yellow;
  border: 6px solid brown;
  right:60px; top:130px;
}

#door{
  width: 120px;
  height: 180px;
  background-color: white;
  border: 6px solid brown;
  bottom:0;left:190px; right: 180px;
}


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0

Challenge Information:

Build a House Painting - Build a House Painting

  1. All of the immediate children of the #house should have a position of absolute.

Have you fulfilled this user story?

the bottom border of the chimney needs to be in the same place as the top border of the house, maybe you do not have them in the right place

I have done that . the error is still there. Here is the error -" 40. Your #chimney should have a top value that puts it at the top of your #house ."

did you try changing the top value for the chimney?

Please post your updated code so we can take a look.

Here is the updated paret of the code "
#chimney{
top: -22.4%; right: 100px;
z-index: -1;
width: 60px;
height: 80px;
background-color: purple;
border: 1px solid black;
}"

and how does it go now?

still getting the same error .

If the heigh of the chimney is 80px how much should you move it up to have the bottom edge line up with the top of your house?

-80px towards the top ,if box-sizing is border-box.

What happens if you apply that to what you have now?

visually its at place but in the checks it fails with the error " Your #chimney should have a top value that puts it at the top of your #house" . i am not getting the reason of this error as i have given top value to the #chimney .i have also tried different units like px ,rem but nothing fixes this issue .

you have not tried a value of top that would move it exactly by its height

Have you tried giving the top value of your #chimney this value?

It worked well finally ! Thanks for the help.

Thanks, Robm, it’s worked.

I did not have the box-sizing so it failed.

Thanks!!

Glad I could help!!!