Build a House Painting - Build a House Painting

Tell us what’s happening:

I’ve been trying to figure out how to make my chimney on top, but still can figure it out.

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="stlyesheet" href="styles.css">
</head>
<body>
<div id="house">
    <div id="chimney"></div>
    <div id="roof"></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;
margin: 200px auto;
width: 500px;
height: 400px;
border: 5px solid black;
background-color: rgba(200, 0, 86, 100%);
z-index: auto;}

#chimney {position: absolute;
top: 500px;
width: 75px;
height: 100px;
border: 2px solid black;
background-color: pink;
z-index: -1;}

#roof {position: absolute;
top: 0;
background-color: crimson;
width: 100%;
height: 20%;
border: 3px solid grey;
z-index: 2;}

#window-1 {position: absolute;
background-color: yellow;
top: 30%;
right: 10%;
width: 20%;
height: 30%;
border: 5px solid black;
z-index: 3;}

#window-2 {position: absolute;
background-color: yellow;
top: 30%;
right: 10%;
width: 20%;
height: 30%;
border: 5px solid black;
z-index: 3;}

#door {position: absolute;
  bottom: 0;
    background-color: goldenrod;
    right: 37%;
    width: 25%;
    height: 50%;
    border: 2px solid rgb(146, 136, 0);
    z-index: 4;
  }}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0

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

Hi there,

If all of the pieces of the house are relative to the house itself and the top of the house is at 0, what would the top of a chimney with a height of 100px need to be set at to put the bottom of the chimney flush with the top of the house?

Happy coding!

I did 100px, but it doesn’t work. I don’t undestand how to calculate that.

500px doesn’t work either. I can’t even see the chimney.

because those values are pushing it from the top to the bottom, so it is inside the house, not above it.

I’ll still dont’ get it pourcentage didn’t work either and it has to be a top rule thingy. :slight_smile:

Nevermind had to be negative.

glad you figured it out!