<div>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
scss Code:
ul {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
li{
flex: 0 0 24%;
border:1px solid red;
height: 40px;
}
}
if the number of li is exactly divisible by 4, it"s no problem. If you add the last one, you will run to the right
is there any way to make the first left of each line of li have no distance from the right, but there is no distance between the two in the middle?
also tries to solve it with pseudo elements, but pseudo elements leave no distance between the last one and the last one
here, and then think that there is a way to add margin-right to the last one, but there will be a problem if the number of li is exactly divisible by 4. Tangled!