How to make a div fill a remaining horizontal space?

前端 未结 25 1441
野的像风
野的像风 2020-11-22 00:45

I have 2 divs: one in the left side and one in the right side of my page. The one in the left side has fixed width and I want the one of the right side to f

25条回答
  •  -上瘾入骨i
    2020-11-22 01:37

    If you are trying to fill remaining space in a flexbox between 2 items, add the following class to a an empty div between the 2 you want to seperate:

    .fill {
      // This fills the remaining space, by using flexbox. 
      flex: 1 1 auto;
    }
    

提交回复
热议问题