I have designed a layout using grids, featuring two menus on the left and right, with a central area for content.
Within the content area, there is a 4x4 grid layout. Here's an example of the 4x4-grid layout: https://codepen.io/mannberg/pen/qemayy
html/pug
body.h-100.body-grid
div.h-100.menyLeft
div.h-100.bg-primary.text-light
div.sidebar-heading.d-flex.justify-content-center
h2 Left Menu
div.h-100.mainContent.d-flex.flex-column.justify-content-center
div.h-100.inner-grid
each val in [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
div.h-100.card.inner-grid-item.bg-secondary
center
h2= val
div.h-100.menyRight
div.h-100.bg-primary.text-light
div.sidebar-heading.d-flex.justify-content-center
h2 Right Menu
css
.inner-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-auto-rows: 1fr 1fr 1fr 1fr;
grid-gap: 16px;
}
.inner-grid-item:nth-child(4n) {
background-color: #20c997 !important;
}
.inner-grid-item:nth-child(3n) {
background-color: #ffc107 !important;
}
shared css between examples
html, body {
height: 100% !important;
margin: 0px;
padding: 0px;
}
.mainContent {
padding-top: 18px;
padding-bottom: 18px;
}
.body-grid {
display: grid;
grid-gap: 10px;
grid-template-columns: 0.125fr 1fr 0.125fr;
grid-template-rows: 100%;
}
Bootstrap4 is essential for some classes used in these examples.
https://i.sstatic.net/eW1jN.png
Another layout features a 2x2 grid in the content area. Here's an example of the 2x2-grid layout: https://codepen.io/mannberg/pen/pMPNOK
html/pug
body.h-100.body-grid
div.h-100.menyLeft
div.h-100.bg-primary.text-light
div.sidebar-heading.d-flex.justify-content-center
h2 Left Menu
div.h-100.mainContent.d-flex.flex-column.justify-content-center
div.h-100.inner-grid2
each val in [0,1,2,3]
div.h-100.card.inner-grid-item2.bg-secondary
center
h2= val
div.h-100.menyRight
div.h-100.bg-primary.text-light
div.sidebar-heading.d-flex.justify-content-center
h2 Right Menu
css
.inner-grid2 {
display: grid;
grid-template-columns: 1fr 1fr;
grid-auto-rows: 1fr 1fr;
grid-gap: 16px;
}
.inner-grid-item2:nth-child(3n) {
background-color: #e83e8c !important;
}
https://i.sstatic.net/rAVJ3.png
If you want to stack the 2x2-grid grid over the 4x4-grid, you can adjust the z-index values in the CSS class .inner-grid2
. Here's an example image of the desired outcome: https://i.sstatic.net/AATSm.png
However, achieving this might require some experimentation with z-index and positioning. If you encounter difficulties, here's a link to a version that didn't turn out as expected: https://codepen.io/mannberg/pen/qemRXa
Please let me know if you need further assistance with using z-index/position to achieve the desired layout.