The solution to the even distribution of flex layout and the ability to wrap lines

 code:

父级:
.parent {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
/* 给父级添加个伪类,占位用    使用伪类元素占据单位,不影响页面 */
.parent:after {  
    content: '';
    width: 30%;
}
子级:
.children{
    width: 30%;
}

Guess you like

Origin blog.csdn.net/m0_56276571/article/details/118798541