Viewport height problem when browser goes fullscreen

一笑奈何 提交于 2019-12-23 05:59:23

问题


Well this is an odd behaviour.

I'm coding the frontend of a metrics app that must be viewed in a large tv. I use Html, Js and Css (bootstrap 4).

It's for general public so we must hide browser tabs, etc.. Whenever I set the browser to go fullscreen, a big white row appears at the bottom of the page. Please see attached picture.

The odd part is that there isn't any element there. It's like the viewport just gets bigger and forgets to cover the bottom with stuff.

Is this a known issue?

How to avoid this and cover on fullscreen?

I'ver tried auto, cover, 100% height, etc..


回答1:


I found the solution right after posting my question.

html,body
{
    min-height:100%;
}

The thing is that if you apply height only to body, it will seek for the parent (html) and found that the size is the same as before so both must have the property in order to get the 100% of the height.



来源:https://stackoverflow.com/questions/56777751/viewport-height-problem-when-browser-goes-fullscreen

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!