/* Reset some default margins */ body, h1 { margin: 0; padding: 0; text-align: center; } /* Container to center the canvas */ .center-container { display: flex; justify-content: center; /* Horizontally center */ align-items: center; /* Vertically center */ height: 100vh; /* Full viewport height to center vertically */ } /* Optional: you can add some margin or padding to the canvas if needed */ canvas { border: 1px solid #ccc; /* Optional border to see the canvas area */ }