CSS flex如何均匀排列子元素

高级justify-content: space-between;

直接使用list的before和after伪元素参与布局

 <ul class="share-list"> <li class="share-item">li> <li class="share-item">li> <li class="share-item">li> ul> 
.share-list{ display: flex; justify-content: space-between; } .share-list:before, .share-list:after{ content: ""; } .share-item{ width: 60px; height: 60px; }

你可能感兴趣的:(前端)