I'm trying to create a row of children elements with equal height. However, the children elements contain images of variable height, so the height should be that of the tallest element. Imagine the following:
<div class="parent">
<div class="child"><img /></div>
<div class="child"><img /></div>
<div class="child"><img /></div>
<div class="child"><img /></div>
</div>
This is the CSS:
.child {float:left;width:25%}
.
I understand this can be done with javascript. However that's out of the question for me (at least I think so) because this is part of an overall responsive design, so the width of the children, while set at 25%, will change with different screen sizes to, say, 50%.
Thanks in advanced!
In in the traditional document flow, parents either size their children or are sized by them, they can't normally do both.
That is without flexbox. If you deal with the modern browser requirement, it's the solution you need. http://osvaldas.info/flexbox-based-responsive-equal-height-blocks-with-javascript-fallback is a good example of how to do these type sizings.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments