如何使用弹性框将第一个按钮对齐到左侧?

时间:2018-02-09 16:33:24

标签: html css css3 flexbox

enter image description here

<div id=actions>
    <button type=button>Back</button>
    <button type=button>Cancel</button>
    <button type=submit>Save</button>
</div>

#actions {
  display: flex;
  justify-content: flex-end;
}

#actions button:nth-child(1) {
  justify-self: flex-start;
}

https://jsfiddle.net/chovy/9hnpwn2n/

1 个答案:

答案 0 :(得分:3)

#actions button:nth-child(1) {
  margin-right: auto;
}