I am trying to build an HTML layout similar to the image below. I can’t seem to get there with Bootstrap 5, and keeping everything responsive.
Any help would be appreciated!
I attempted to make two columns, one for the large card.. and then have the smaller cards on the right. But the right column only stacked on top of each other, not side by side…
2
Answers
Bootstrap as a framework is good at solving most problems. However, it is not a solution for everything.
The Bootstrap grid consists always of 12 columns. Your grid in the picture has 7 columns. 7 columns can’t be fit into 12 (1,2,3,4,6 could).
So you’re left to write your own grid.
First, you need a container and create a 7-column layout. You can do that by using this CSS:
next, you have to let the first block span multiple columns and rows which can be done by adding this to the first card:
If you want to have the smaller boxes as squares like in your picture, you can simply use
aspect-ratio: 1;
This of course can be done responsive as well. If so, you need to provide more details on how the grid should change on certain viewports.
Yes, You can create layout using bootstrap Here is code
it is same as you shown for only more then 768px view port
fiddle link :
https://jsfiddle.net/qnx6mjky/