Bootstrap 4 Navbar and content fill height flexbox

前端 未结 1 806
庸人自扰
庸人自扰 2020-11-29 13:18

I have to create a layout in which a content grid has to be on the full remaining page, but the layout has also a navigation bar.

In order to do this I decided to pl

1条回答
  •  渐次进展
    2020-11-29 14:02

    Instead of using h-100 on the yellow content area, add an extra CSS class to make it flex-grow:1 in height...

    .flex-fill {
      flex:1 1 auto;
    }
    

    https://www.codeply.com/go/xBAMfbHqbN

    
    

    Note: The flex-fill utility class will be included in the next Bootstrap 4.1 release: https://github.com/twbs/bootstrap/commit/2137d61eacbd962ea41e16a492da8b1d1597d3d9

    (Updated Bootstrap 4.1 demo)


    Related question: Bootstrap 4: How to make the row stretch remaining height?

    0 讨论(0)
提交回复
热议问题