Limit flexbox height to browser window (currently it's overflowing causing vertical scroll)

后端 未结 2 649
梦毁少年i
梦毁少年i 2021-01-18 02:14

I\'m trying to have an app that fit the window size of the browser.

The menu should have a height that fit 100% of the parent and not have a height of 100% of the sc

2条回答
  •  伪装坚强ぢ
    2021-01-18 02:27

    For main containers like these, it's best to use 100vh and 100vw.

    Read here about the modern CSS units: http://tutorialzine.com/2015/05/simplify-your-stylesheets-with-the-magical-css-viewport-units/

    Don't forget to use inherit as much as possible on children elements (when it works). This way you ensure a proper cascade of height elements.

提交回复
热议问题