As far as I was aware, vh
and vw
used the height and width of the visual viewport - the size of the browser window, and divided it by 100. Therefore, if you defined an element to be 100vw wide, it will always span the entire browser window, what MDN calls the visual viewport.
When working on my website, I found that an element set to 100vw is only taking up a portion of the screen, and that this is only visible on mobile devices - the error is absent until I open the chrome device toolbar.
The dark grey <section>
elements are set to height: 100vh; width 100vw;
, and I also have
html,body {
height:auto;
width:100vw;
margin:0;
padding:0;
}
I have tried the website on my phone and the error is still present, but it is not present on a resized chrome window. What have I missed?