Question:
I have a canvas that automatically resizes, so it stretches from the top of the screen to the bottom of the screen while keeping a 1:1 Ratio. My problem is that I want to center it in the middle of the screen so that it looks nice. Ideally I want to use CSS and HTML to center it.
// Here is the code I've tried to center it.
<div style="text-align:center;">
<canvas id="canvas"></canvas>
</div>
/* Unfortunately, this didn't center it correctly.
Furthermore, when the screen has more height than width,
the canvas goes to the top left corner. */