I have two boxes like:
<div class="box">
<div class="content">Here goes content 1.</div>
</div>
<div class="box">
<div class="content">Here goes content 2.</div>
</div>
.content {height:150px;width:65px;}
Now it can be that the text of content 1 doesn’t fit the height of 150px. The div stretches.
How can I achieve that the class changes the height so that the second content will have the same height as content 1?
This does not feel too elegant, but it works (at least in FF, Chrome and Safari for Mac, as I did not have the time to test it in IE):
Don’t forget to remove the
height:150pxfrom your css or the height of the elements won’t be adjusted.