html { height: 100%; } body { height: 100%; margin: 0; } canvas { height: 100%; width: 100%; object-fit: contain; }