I want to create nested divs for positioning children with top and left properties, allowing them to overlap each other:
https://jsfiddle.net/e0cpuarv/
.boo {
position: absolute;
left: 10px;
top: 10px;
width: 100px;
height: 70px;
background-color: red;
}
.kah1 {
position: absolute;
left: 20px;
top: 30px;
width: 50px;
height: 50px;
background-color: green;
}
.kah2 {
position: absolute;
left: 30px;
top: 40px;
width: 50px;
height: 50px;
background-color: blue;
}
<body>
<div class="boo">
<div class="kah1"></div>
<div class="kah2"></div>
</div>
</body>
I have managed to position the elements, but the children are just overlapping on top of the parent. Any suggestions on how to make them stay inside the parent container as shown in this image:
In addition, I am open to using IMG tags instead of DIVs if that makes it easier.