I have a row of 4 products, essentially like so:
<div class="row">
<div class="col-xs-6 col-sm-3">
<div class="image">
<img src="...">
</div>
<div class="text">
Text here
</div>
</div>
<div class="col-xs-6 col-sm-3">
<div class="image">
<img src="...">
</div>
<div class="text">
Text here
</div>
</div>
<div class="col-xs-6 col-sm-3">
<div class="image">
<img src="...">
</div>
<div class="text">
Text here
</div>
</div>
<div class="col-xs-6 col-sm-3">
<div class="image">
<img src="...">
</div>
<div class="text">
Text here
</div>
</div>
</div>
This looks great on desktop:
However on mobile it breaks apart:
All images have the same height, therefore I think this is due to the differing caption lengths. I don't want to have a set height on the <div class="text">
as I cannot guarantee that the caption will fit within it.
Is there a clever way in CSS (or jQuery if must) to set the heights of the captions to equal the tallest caption in the row? This would have to fire on browser resize too.
Thanks