作者:sferra石_455 | 来源:互联网 | 2022-10-12 05:23
如何解决《Howdoarrangedivsintotworowsofthreecolumns,separatedbyevenvsoddchildren?》经验,为你挑选了1个好方法。
I have a parent div with 6 children divs as follows
I want to have a result like this
2 4 6
1 3 5
1> Ori Drori..:
您可以使用flexbox并更改:nth-child(odd)
项目的顺序:
.work-wrap {
display: flex;
flex-wrap: wrap;
}
.work-item {
width: 33%;
}
.work-item:nth-child(odd) {
order: 1;
}