Tell us what’s happening:
I’ve positioned the chimney a little below the house so I can visually see how it stacks. Not sure what I am doing wrong with the z-index here, it’s still on top of the house for some reason.
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="styleseet" href="styles.css">
</head>
<body>
<div id="sky"></div>
<div id="grass"></div>
<div id="house">
<div id="chimney">
<div id="brick"></div>
<div id="brick"></div>
<div id="brick"></div>
<div id="brick"></div>
</div>
<div id="roof"></div>
<div id="window-1">
<div id="windowpane"></div>
</div>
<div id="window-2">
<div id="windowpane"></div>
</div>
<div id="door">
<div id="door-knob"></div>
</div>
</div>
</body>
</html>
/* file: styles.css */
#sky {
width: 100vw;
height: 600px;
background-color: skyblue;
position: fixed;
}
#grass {
width: 100vw;
height: 100vh;
background-color: green;
position: fixed;
top: 600px;
}
#house {
width: 500px;
height: 400px;
background-color: brown;
border: maroon solid 5px;
position: relative;
z-index: 2;
top: 300px;
left: 450px;
}
#chimney {
width: 100px;
height: 150px;
background-color: brown;
border: maroon solid 5px;
position: absolute;
z-index: 1;
top: -155px;
left: 330px;
}
#brick {
width: 100px;
height: 26px;
border-bottom: maroon solid 5px;
}
#roof {
width: 494px;
height: 130px;
background-color: chocolate;
position: absolute;
top: 0px;
border: dashed goldenrod 2px;
}
#window-1 {
width: 100px;
height: 80px;
background-color: cornsilk;
border: goldenrod solid 3px;
position: absolute;
top: 170px;
left: 25px;
}
#window-2 {
width: 100px;
height: 80px;
background-color: cornsilk;
border: goldenrod solid 3px;
position: absolute;
top: 170px;
right: 25px;
}
#windowpane {
width: 50px;
height: 80px;
border-right: goldenrod solid 3px;
}
#door {
width: 120px;
height: 200px;
background-color: indianred;
border: maroon solid 3px;
position: absolute;
left: 190px;
bottom: 0px;
}
#door-knob {
width: 15px;
height: 15px;
background-color: maroon;
border-radius: 25px;
position: absolute;
right: 5px;
bottom: 80px;
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Safari/605.1.15
Challenge Information:
Build a House Painting - Build a House Painting