I am struggling with setting the height of a parent div that contains a nested child div with absolute positioning. The child div has a fixed height of 652px, but I cannot seem to get the parent div to match this height. I have tried adjusting the clear and overflow properties without success.
Below is the code snippet:
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;
}
The content div's height remains at 0 while the container div's height is set to 652px. How can I make the content div's height equal to that of the container div?