How to set parent div's height as child div with position: absolute
问题 I have parent div which has no height, there is also nested another child div with position absolute inside it. Child div has 652px of height. But I cannot get the same height in parent div. I tried to play with clear: both, overflow. Here is the code: HTML <div class="content"> <div class="container"> some other elements whose height is 652px... </div> </div> CSS .content { position: relative; } .container { position: absolute; width: 100%; max-width: 1160px; margin: 0 auto; padding: 120px 0