What is the best way to solve this issue. Obviously all browsers on mobile have got a UI (address bar etc) at the top. This adds additional height to the viewport, so my website
Use height: 100%
which gives you the height after reducing the menu bar's height.
You can test the difference between 100vh
and 100%
by using document.getElementsByTagName('html')[0].scrollHeight
on mobile browser.
For me (Chrome on Andriod), 100vh
returns a higher value than 100%
, which always giving me a vertical scrollbar, even if I haven't added anything in the html body.