Is there a way to make all elements in a row class the same height?

前端 未结 3 520
北海茫月
北海茫月 2020-12-13 07:36

In Bootstrap, is there an easy way to make all the span elements in a row the same height, i.e. the height of the tallest element?

Here\'s an example of what I mean.

3条回答
  •  忘掉有多难
    2020-12-13 07:39

    You can do it using jQuery:

    boxes = $('.well');
    maxHeight = Math.max.apply(
      Math, boxes.map(function() {
        return $(this).height();
    }).get());
    boxes.height(maxHeight);
    

    Here's an example: http://jsfiddle.net/DVnZ6/3/

提交回复
热议问题