Benjamin Gibbs710 Benjamin Gibbs710 - 2 years ago 73
CSS Question

Canvas to span entire page

Building a website for my photography and I'm struggling to make the back ground canvas span the entire height of the page. Also the stars inside the canvas become elongated sometimes - you have to refresh to make them the correct size.

The html code for the canvas :

<canvas id="canvas"></canvas>

css code :

canvas {
min-height: 100%;
background: #111;

Link to page:

Image: Doesn't span page

Answer Source

Since you would like the canvas to serve as a background image. why not position the element fixed to the screen?

example position:fixed (you have already set width and height of 100%)

    position: fixed;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download