Build a House Painting - Build a House Painting

Tell us what’s happening:

Having trouble with #42 "Your windows should be placed below your #roof and at least higher than one third of your #door’s height.” My windows are below the roof, and they are higher than my door. What am I doing wrong?

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 id="grass"></div>
</div>
</body>
</html>
/* file: styles.css */
body {
  background-color: #c9d2fc;
}

#roof {
  background-color: brown;
  width: 500px;
  height: 100px;
  border: 1px solid black;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
}

#house {
  background-color: pink;
  width: 500px;
  height: 400px;
  border: 1px solid black;
  position: relative;
  top: 200px;
  bottom: 0;
  left: 100px;
  right: 0;
  z-index: 2;
}

#chimney {
  background-color: red;
  width: 125px;
  height: 125px;
  border: 1px solid black;
  position: absolute;
  top: -125px;
  bottom: 0;
  left: 300px;
  right: 0px;
  z-index: 1;

}

#window-1 {
  background-color: white;
  width: 100px;
  height: 100px;
  border: 1px solid black;
  position: absolute;
  top: 150px;
  bottom: 0;
  left: 70px;
  z-index: 4;
}

#window-2 {
  background-color: white;
  width: 100px;
  height: 100px;
  border: 1px solid black;
  position: absolute;
  top: 150px;
  bottom: 0;
  left: 350px;
  z-index: 4;
}

#door {
  background-color: yellow;
  width: 125px;
  height: 150px;
  border: 1px solid black;
  position: absolute;
  top: 240px;
  bottom: 0px;
  left: 200px;  
  z-index: 2;
}

Your browser information:

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

Challenge Information:

Build a House Painting - Build a House Painting

Here’s what I’m reading.

You need to move each of your windows up by at least one third of the height of your door element.

There’s a way to manually move an element up by using offsets. I’m pretty sure that’s what is being referred to here.

1 Like

It ended up being the “bottom”:

#window-1 {
  background-color: white;
  width: 100px;
  height: 50px;
  border: 1px solid black;
  position: absolute;
  top: 115px;
  **bottom: 60px;**
  left: 70px;
  z-index: 4;
}

#window-2 {
  background-color: white;
  width: 100px;
  height: 50px;
  border: 1px solid black;
  position: absolute;
  top: 115px;
  **bottom: 60px;**
  left: 350px;
  z-index: 4;

I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').