How do I make a div full screen?

后端 未结 10 1898
耶瑟儿~
耶瑟儿~ 2020-12-07 10:59

I am using Flot to graph some of my data and I was thinking it would be great to make this graph appear fullscreen (occupy full space on the monitor) upon clicking on a butt

10条回答
  •  忘掉有多难
    2020-12-07 11:24

    For fullscreen of browser rendering area there is a simple solution supported by all modern browsers.

    div#placeholder {
        height: 100vh;
    }
    

    The only notable exception is the Android below 4.3 - but ofc only in the system browser/webview element (Chrome works ok).

    Browser support chart: http://caniuse.com/viewport-units

    For fullscreen of monitor please use HTML5 Fullscreen API

提交回复
热议问题