Search code examples
javascriptcsswindowviewportsizing

App is rendering larger than viewport when I try to apply dynamic css sizing attributes


I have tried applying 100vh to the divs root/body/application (these are my top 3 level divs) and my app continues to render larger than the viewport or browser window. I am using display: flex on the child divs.

I am trying to just get the app to fit the window.


Solution

  • Try adding the following to your element that you set to 100vh

    box-sizing: border-box;
    

    This should make sure that any borders, padding or margins won't make the element bigger than the 100vh you've set it to.