-1

Why Flexbox adds a left-padding on a horizontal list even with justify-content: space-between ?

 <div class="list-container">
   <ul>
     <li>One</li>
     <li>Two</li>
     <li>Three</li>
     <li>Four</li>
     <li>Five</li>
   </ul>
</div>
.list-container {
  width: 500px;
  background-color: darkseagreen;
}
.list-container ul {
  display: flex;
  justify-content: space-between;
  list-style: none;
}
.list-container li {
  flex: 0 0 auto;
  background-color: darkorange;
}

jsfiddle : https://jsfiddle.net/telemacus/vdo9a54c/10/

adding "padding-left: 0" on "ul" fixes the problem.

joe cool
  • 315
  • 7
  • 14

1 Answers1

0

You need to remove padding use:

ul{
  padding: 0;
}

Updated JSFiddle: https://jsfiddle.net/w783mxaf/