When I create a canvas such as:
Solution 2:
Body by default doesn't have height. You could do.
html, body {
min-height: 100%;
}
This will give the body a height so the canvas can grow the that size
Solution 3:
You could add position:fixed;
and left:0; top:0;
to your style. This will keep your canvas on full screen.
<!DOCTYPE html>
<html>
<body>
<canvas></canvas>
<style>
canvas{
background-color: #FF0000;
position:fixed;
left:0;
top:0;
width:100%;
height:100%;
}
</style>
</body>
</html>
Post a Comment for "Canvas Resizes On Width But Not Height"