我有以下情况:
.flex-container {
padding: 0;
margin: 0;
list-style: none;
display: flex;
flex-wrap:wrap;
justify-content: space-around;
}
.flex-item {
background: tomato;
padding: 5px;
width: 150px;
height: 75px;
margin-top: 10px;
line-height: 75px;
color: white;
font-weight: bold;
font-size: 3em;
text-align: center;
}

<ul class="flex-container">
<li class="flex-item">1</li>
<li class="flex-item">2</li>
<li class="flex-item">3</li>
<li class="flex-item">4</li>
<li class="flex-item">5</li>
</ul>
&#13;
http://codepen.io/HugoGiraudel/pen/LklCv
我想要改变一件事: 左边和右边的div在父div和它自身之间不应该有空格。
当我justify-content: space-between
时,问题就解决了,但div不再居中。