I'm trying to make the fullscreen option work in html/javascript.
I have placed my canvas and buttons in a div, fullscreen works, But now I want to center my game in the middle of the screen, and I want my canvas height to be equal to the monitor height of the display. And I want my width to be equal to my height. So my canvas has the shape of a square.
I think I need css for this, but I never used it so I don't know where to start.
My html code looks now like this:
<div id="theGame">
<canvas id="canvas" width="500" height="500" style=" position:absolute; top:40px; left:0px; border:6px ridge #FFAB00;"></canvas>
<button buttonSpecs... </button>
<button buttonSpecs... </button>
</div>
Currently when I'm in fullscreen it looks like this: https://www.dropbox.com/s/ee4bv0cn2tm2nns/fullscreen.jpg
But thats not how I want it, I want it like this: https://www.dropbox.com/s/cu54fqz0gzap1ul/howIwant.jpg