How to make a div fill a remaining horizontal space?

前端 未结 25 1412
野的像风
野的像风 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条回答
  •  被撕碎了的回忆
    2020-11-22 01:33

    You can use the Grid CSS properties, is the most clear, clean and intuitive way structure your boxes.

    #container{
        display: grid;
        grid-template-columns: 100px auto;
        color:white;
    }
    #fixed{
      background: red;
      grid-column: 1;
    }
    #remaining{
      background: green;
      grid-column: 2;
    }
    Fixed
    Remaining

提交回复
热议问题