strong text
.inside{
position: absolute;
background-color:red;
top:0px;
left:0px;
width:200px;
height: 200px;
}
.inside2{
height: 210px;
background-color: blue;
}
.inside3{
height: 220px;
background-color: black;
}
.box {
position: relative;
}
<html>
<body>
<div class="box">
<div class="inside"></div>
<div class="inside"></div>
</div>
<div class="box">
<div class="inside inside2"></div>
<div class="inside inside2"></div>
</div>
<div class="box">
<div class="inside inside3"></div>
<div class="inside inside3"></div>
</div>
</body>
</html>
So I have 2 div(inside class) that overlap, its size is unfixed (it maybe 200px or 210px ...). I already make it overlap using positive: absolute and set the box to be relative. The problem with the box is it have 0px height so these boxes just overlap the same position (instead 3 individual box). How to fix it: