CSS - Equal Height Columns?

前端 未结 11 1116
情歌与酒
情歌与酒 2020-11-21 06:08

In CSS, I can do something like this:

But I\'ve no idea how to change that to something like:


Is this possible with CSS?

11条回答
  •  灰色年华
    2020-11-21 06:38

    Another option is to use a framework that has this solved. Bootstrap currently doesn't have an equal height option but Foundation by Zurb does, and you can see how it works here: http://foundation.zurb.com/sites/docs/v/5.5.3/components/equalizer.html

    Here's an example of how you'd use it:

    Basically they use javascript to check for the tallest element and make the others the same height.

    So, if you want just css this would add more code, but if you are already using a framework then they have already solved this.

    Happy coding.

提交回复
热议问题