5 items per row, auto-resize items in flexbox

后端 未结 4 1602

I have this at the moment:

4条回答
  •  长情又很酷
    2020-11-27 18:53

    Here is a possible solution: https://jsfiddle.net/9f955jk2/3/ You have to be aware of margins or paddings, that's why I setted the width to 18% You can set them to 20% (100%/5 items per row) if you will remove all the margins and paddings. Also don't forget that border will also take some space. The container should have 100%, otherwise you have to divide the width by 5 and specify it in pixel for each item and not in %

     .container {
          width:100%;
        }
    

提交回复
热议问题