body { margin: 0%; padding: 0; height: 100vh; width: 100vw; overflow: hidden; background-color: black; } .div { margin-top: 2%; margin-right: 5%; margin-left: 5%; margin-bottom: 2%; height: 100%; width: 100%; position: relative; } .div1 { top: 0; left: 0; height: 30%; width: 30%; display: flex; position: absolute; overflow: hidden; } .div2 { top: 0%; left: 31%; height: 30%; width: 30%; display: flex; position: absolute; overflow: hidden; } .div3 { top: 0%; left: 62%; height: 30%; width: 30%; display: flex; position: absolute; overflow: hidden; } .div4 { top: 31%; left: 0%; height: 30%; width: 30%; display: flex; position: absolute; overflow: hidden; } .div5 { top: 31%; left: 31%; height: 30%; width: 30%; display: flex; position: absolute; overflow: hidden; } .div6 { top: 31%; left: 62%; height: 30%; width: 30%; display: flex; position: absolute; overflow: hidden; } .div7 { top: 62%; left: 0%; height: 30%; width: 30%; display: flex; position: absolute; overflow: hidden; } .div8 { top: 62%; left: 31%; height: 30%; width: 30%; display: flex; position: absolute; overflow: hidden; } .div9 { top: 62%; left: 62%; height: 30%; width: 30%; display: flex; position: absolute; overflow: hidden; }