While Bootstrap excels at solving many problems, it is not a one-size-fits-all solution.
The Bootstrap grid always consists of 12 columns, but your grid in the image only has 7 columns. It's impossible to fit 7 columns into 12 (1, 2, 3, 4, 6 could).
Therefore, you'll need to create your own grid.
Start by creating a container and designing a 7-column layout. You can achieve this with the following CSS:
.container {
display: grid;
grid-template-columns: repeat(7, 1fr);
}
Next, allow the first block to span multiple columns and rows by adding this to the first card:
.first-card {
grid-column: span 3;
grid-row: span 2;
}
If you want the smaller boxes to be squares like in your picture, you can simply use aspect-ratio: 1;
/* script specifically for creating the elements */
for (let i = 0; i < 23; i++) {
let card = document.createElement('div');
card.classList.add('card');
card.textContent = i + 1;
container.appendChild(card);
}
#container {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 0.5em;
.card {
background-color: orange;
color: white;
font-size: 2em;
display: flex;
justify-content: center;
align-items: center;
&:nth-child(1) {
grid-column: span 3;
grid-row: span 2;
}
&:not(:nth-child(1)) {
aspect-ratio: 1;
}
}
}
<div id="container"></div>
This setup can also be made responsive. If needed, provide more specifics on how the grid should adjust on different screen sizes.