CSS align one item right with flexbox

前端 未结 3 1993
误落风尘
误落风尘 2020-11-28 01:28

https://jsfiddle.net/vhem8scs/

Is it possible to have two items align left and one item align right with flexbox? The link shows it more clearly. The last example is

3条回答
  •  没有蜡笔的小新
    2020-11-28 01:43

    For a terse, pure flexbox option, group the left-aligned items and the right-aligned items:

    One Two
    Three

    and use space-between:

    .wrap {
      display: flex;
      background: #ccc;
      justify-content: space-between;
    }
    

    This way you can group multiple items to the right(or just one).

    https://jsfiddle.net/c9mkewwv/3/

提交回复
热议问题