How do I make a div full screen?

后端 未结 10 1897
耶瑟儿~
耶瑟儿~ 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:42

    When you say "full-screen", do you mean like full-screen for the computer, or for taking up the entire space in the browser?

    You can't force the user into full-screen F11; however, you can make your div full screen by using the following CSS

    div {width: 100%; height: 100%;}
    

    This will of course assume your div is child of the tag. Otherwise, you'd need to add the following in addition to the above code.

    div {position: absolute; top: 0; left: 0;}
    

提交回复
热议问题