0
I have this very simple code, my div#d4
is coming out of your container and falling into the div#d2
this because the div
daughters do not fit in the div
father. And by defining a position: absolute
for her. She appears again, but because in this case the z-index does not work ?
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#d1, #d2, #d3, #d0, #d4 {
width: 200px;
height: 200px;
color: white;
}
#d0 {
background-color: aqua;
}
#d1 {
background-color: tomato;
}
#d2 {
background-color: green;
}
#d3 {
background-color: blue;
}
#d4 {
background-color: yellow;
z-index: 1;
}
</style>
</head>
<body>
<div id="d1">
content1
<div id="d0">
content0
</div>
<div id="d4">
content4
</div>
</div>
<div id="d2">
content2
</div>
<div id="d3">
content2
</div>
</body>
</html>