.propertydetailbox2 {
overflow:auto;
border: 1px black solid;
}
.propertydetailtextbox {
width: 30%;
float:left;
border: 1px solid #cccccc;
border-radius: 8px;
margin: 0 auto;
margin-right:1%;
padding:20px;
padding-left:50px;
height: auto;
text-align:left;
}
.propertydetailagentbox {
width: 30%;
height: 100%;
float:left;
border: 1px solid #cccccc;
border-radius: 8px;
margin: 0 auto;
margin-left:1%;
padding:20px;
}
<div class ="propertydetailbox2">
<div class="propertydetailtextbox">1<br>2<br>3<br>4<br> </div>
<div class="propertydetailagentbox">1<br>2</div>
</div>
hi i have one container which contains two boxes (child boxes), i want the parent to take the height of the tallest child which is already done using overflow:auto;
, then i want the second child (which is short) to be same height as the parent. i have tried various solutions given here CSS - Expand float child DIV height to parent's height but using relative and absolute stack the child divs on top of each other, and using margin-bottom: -99999px; padding-bottom: 99999px; cuts the border of the second child from the bottom, i need responsive solution.
parent div
.propertydetailbox2 {
overflow:auto;
}
child1
.propertydetailtextbox {
width: 30%;
float:left;
border: 1px solid #cccccc;
border-radius: 8px;
margin: 0 auto;
margin-right:1%;
padding:20px;
padding-left:50px;
height: auto;
text-align:left;
}
child2
.propertydetailagentbox {
width: 30%;
height: 100%;
float:left;
border: 1px solid #cccccc;
border-radius: 8px;
margin: 0 auto;
margin-left:1%;
padding:20px;
}
please see edit of jsfiddle the divs should be side by side but in jsfiddle they are coming on top of each other