Answer the question
In order to leave comments, you need to log in
How to make such a box (as in the example) with GRID or Flexbox?
I saw an example like this, it's very cool that this box in the example has the same height and width. I really tried to make such a box with flexbox or with grid, so that I could then break it into columns for the mobile view, but nothing came of it.
https://codepen.io/alexlcs/pen/ZbmzPE
<div class="grid-container">
<div class="grid-item"><div>
<div class="grid-item"><div>
<div class="grid-item"><div>
<div class="grid-item"><div>
</div>
Answer the question
In order to leave comments, you need to log in
Boxes, put in a wrapper container, with the necessary styles.
For Flex:
.wrapper {
display: flex;
flex-wrap: wrap;
}
.box {
flex-grow: 1;
width: 50%;
padding: 10px;
overflow: auto;
}
.wrapper {
display: grid;
grid-template-columns: repeat(2, 50%);
}
.box {
padding: 10px;
overflow: auto;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question