Full page canvas problem

This may be stupid but I can’t seem to get my canvas to fill the whole webpage. I create the canvas with

<body onload="webGLStart();">

	<script type="text/javascript">
		var X = document.body.clientWidth;
		var Y = document.body.clientHeight;
		document.write('<canvas id="test" style="border: none;" width="'+X+'" height="'+Y+'"></canvas>')


but I always have scroll bars and the canvas doesn’t start at the very top left. There is a little gap. Any ideas?

You have to play with css, try something like this:

body {
    margin: 0;
    padding: 0;

#test {
    margin: 0;
    padding: 0;

Ah, worked like a charm. Thanks a lot.