space-evenly (justify-content) not working on Chrome mobile

Viewed 19414

I have an issue with the space-evenly value for justify-content on Chrome mobile (it works fine on Desktop and on Firefox mobile).

I managed to produce a minimal example: Example

I have a flex container in a row direction and I want the elements to be spaced evenly, as intended when using space-evenly. It works on desktop, but on Chrome mobile (version 59 on Android), however, the elements are aligned on the left. Here is a comparison of the two: Comparison

center and space-around values work as intended, however, but I really want to use space-evenly or an equivalent (the flex-wrap: wrap behavior is also important to me).

Here is my HTML:

<div class="container">
  <div class="element"></div>
  <div class="element"></div>
  <div class="element"></div>
</div>

And here is my CSS:

.container {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  flex-wrap: wrap;
  background: lightgrey;
}

.element {
  margin: 8px;
  width: 42px;
  height: 42px;
  background: black;
}

Thanks in advance!

3 Answers

You can try adding different values of

flex-direction:
Related