Getting inline-block element's height to fill the parent

前端 未结 4 2059
庸人自扰
庸人自扰 2020-12-29 02:20

I have a container with two items. One of those items is a select element, so I need to set the size attribute via HTML. I want the other item in

4条回答
  •  误落风尘
    2020-12-29 02:25

    If table-cell is an option, here's a way to do it:

    .container {
      display: table;
      width: 100%;
      padding: 5px;
      border: 1px solid black;
    }
    
    .container .column {
      display: table-cell;
      width: 40%;
      background-color: #AAA;
      padding: 5px;
      border: 5px solid white;
      vertical-align: top;
      height: 100%;
    }
    
    select {
      width: 100%;
    }
    Stretch to fill?

提交回复
热议问题