<div class="portfolio__body">
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
</div>
I’ve tried to do it with flex
but it didn’t work.
I want the cubes to be like in the picture
2
Answers
You can do something like this, using
flexbox
as specified. The trick here is to useflex-wrap
so the squares do not overflow your container. Have in mind to adjust themax-width
ofportfolio__body
according to your need. Hope this helps.