Making the content inside grid items equal height in CSS Grid

后端 未结 3 1371
孤街浪徒
孤街浪徒 2021-01-18 08:01

I am trying to figure out how to get two columns of my grid the same height. Here is what I am after:

xxxxxxxxxxxxxxxxx   xxxxxxxxxxxxxxxxxxx 
x qqqqqqq
3条回答
  •  后悔当初
    2021-01-18 08:27

    use display property flex with item height auto

    for example

    .flex-container {
    display: flex;
    width: 400px;
    height: auto;
    

    }

    .flex-item {
    background: red;
    width: 100px;
    height: auto;
    margin: 10px;
    

    }

提交回复
热议问题