There is a regular flebox with elements:
.flexbox { display: flex; border: 2px solid red; padding: 2.5px; } .flexbox__item { border: 2px solid blue; height: 50px; margin: 2.5px; flex-grow: 1; } <div class="flexbox"> <div class="flexbox__item"></div> <div class="flexbox__item offset-1"></div> <div class="flexbox__item"></div> </div> How to insert into this flexbox an empty cell after offset I do not use additional markup and after with before?
Those. you need to come out like this, but without specifying the width of the blocks. Only flex-grow
.flexbox { display: flex; border: 2px solid red; padding: 2.5px; } .flexbox__item { border: 2px solid blue; height: 50px; margin: 2.5px; width: 25%; } .offset-1 { margin-right: calc(25% + 5px); } <div class="flexbox"> <div class="flexbox__item"></div> <div class="flexbox__item offset-1"></div> <div class="flexbox__item"></div> </div> The number of cells is unknown. Offset-1 means that you need to make an empty single cell, offset-2 - two, and so on.