As it can be seen in the following fiddle, I have two div
s, contained in a parent div
that have stretched to contain the big div, my goal is to make those child div
s equal in height.
https://www.youtube.com/watch?v=jV8B24rSN5o
I think you can use display as grid:
.parent { display: grid };
You can do it easily with a bit of jQuery
$(document).ready(function(){
var parentHeight = $("#parentDiv").parent().height();
$("#childDiv").height(parentHeight);
});
Use display: flex
to stretch your div
s:
div#container {
padding:20px;
background:#F1F1F1;
display: flex;
}
.content {
width:150px;
background:#ddd;
padding:10px;
margin-left: 10px;
}
Add the following CSS:
For the parent div:
style="display: flex;"
For child div:
style="align-items: stretch;"
Source: Stackoverflow.com