Ordering flex items

前端 未结 3 532
自闭症患者
自闭症患者 2021-01-06 11:31

Suppose I have this:



        
3条回答
  •  粉色の甜心
    2021-01-06 12:04

    Reverse the row order by using row-reverse instead of row for the flex-direction.

    flex-direction: row-reverse;
    

    You can also order the children manually by giving them each an order property that takes an integer.

    .flex-container :nth-child(1) { order: 3; }
    .flex-container :nth-child(2) { order: 2; }
    .flex-container :nth-child(3) { order: 1; }
    

提交回复
热议问题