How to make an inline-block element fill the remainder of the line?

前端 未结 7 1611
抹茶落季
抹茶落季 2020-11-28 01:11

Is such a thing possible using CSS and two inline-block (or whatever) DIV tags instead of using a table?

The table version is this (borders added so you can see it):

7条回答
  •  孤城傲影
    2020-11-28 01:47

    I've used flex-grow property to achieve this goal. You'll have to set display: flex for parent container, then you need to set flex-grow: 1 for the block you want to fill remaining space, or just flex: 1 as tanius mentioned in the comments.

提交回复
热议问题