body { margin: 0; overflow: hidden; background-color: black; } #game-area { position: relative; width: 100vw; height: 100vh; } #player { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: 50px; height: 30px; background-color: green; } .invader { position: absolute; width: 40px; height: 40px; background-color: red; } .bullet { position: absolute; width: 5px; height: 15px; background-color: yellow; }