CSS - Equal Height Columns?

前端 未结 11 1134
情歌与酒
情歌与酒 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:48

    Give overflow: hidden to the container and large (and equal) negative margin and positive padding to columns. Note that this method has some problems, e.g. anchor links won't work within your layout.

    Markup

    CSS

    .container {
        overflow: hidden;
    }
    
    .column {
        float: left;    
        margin-bottom: -10000px;
        padding-bottom: 10000px;
    }
    

    The Result

提交回复
热议问题