0

the child's height is more than it's parent div. Do we have some trick for this? or alternative solution.

i just simplified the codes. i also have codepen here you see it in the codepen that the child is overlapping to footer. I want the footer to go below the child.

html

<div class="wrapper">
<div id="sibling-1">
  <div class="child"></div>
</div>
<footer id="sibling-2"></footer>
</div>

css

.wrapper {
  height: 500px;
  background: pink;
}
#sibling-1 {
  background: grey;
  height: 200px;
  width: 300px;
  position: relative;
}
.child {
  position: absolute;
  background: green;
  width: 250px;
  height: 300px;
}
#sibling-2 {
  width: 300px;
  height: 200px;
  background: blue;
}
Jayrex
  • 245
  • 1
  • 4
  • 19

0 Answers0