On selecting the canvas width and height using window.innerWidth and window.innerHeight should set the canvas width and height to fit the screen that is exclusive of toolbars and everything, but somehow it exceeds the html height and width.
<style>
body, html {
margin: 0;
padding: 0;
}
</style>
<body>
<canvas id="myCanvas"></canvas>
<script>
var myCanvas = document.getElementById("myCanvas");
var c = myCanvas.getContext("2d");
myCanvas.width = window.innerWidth;
myCanvas.height = window.innerHeight;
myCanvas.style.backgroundColor = "#000000";
</script>
</body>
how do i fix this?? I have seen other samples and they do exactly the same but that's not working in my code.