You use margin-right: auto to move the whole element to the left, which also forces the element to take the width of its content.
This is a good method, but as you already noted, it does not work in Safari.
A simple alternative is to use align-self: flex-start for flex items:
.row-item { padding: 5px; margin: 5px; border: 1px solid green; align-self: flex-start; }
OR, just use align-items: flex-start in the flex container.
.container { margin: 10px; border: 2px solid #999; padding: 5px; display: flex; flex-direction: column; align-items: flex-start; width: 300px }
source share