例如: 这种情况只需要使用css选择器将flex的最后一个元素设置为margin-right:auto即可解决问题 .row .card:last-child { margin-right: auto; } 加上之后的效果: