Control the number of items on each flex-line when container is set to wrap

前端 未结 2 1509
梦毁少年i
梦毁少年i 2021-01-21 22:03

I am using css flexbox to distribute a number of items in a container. I have a flex container like this:

.container{
    display: flex;
    flex-flow: row wrap;         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-21 22:40

    Do you mean flex-basis?

    .container .item {
        flex-basis: 25%;
    }
    

    It will divide to maximum 4 item per row.

提交回复
热议问题