- By default, the canvas element has an
inline display. - HTML collapses all multiple instances of spaces into one space.
These two properties combine in your case (and many others) to create a small gap between your elements. You have a line break between your canvases:
<canvas></canvas> <canvas></canvas>
The browser thinks you're just trying to insert a bunch of spaces between two inline elements. He thinks you are trying to do something like this:
<p>Best of all for man would be to never exist, second best would be to die soon.</p>
Thus, he "collapses" these line breaks into one space. This is for the same reason that the above paragraph, for the most part, will appear as a single normal line of text.
tl; dr Put your canvases on one line.
As @thirtydot shows, here's how to get rid of the gap:
<canvas> ... </canvas><canvas> ... </canvas>
source share