It’s not perfect, but this is the only solution I’ve seen that achieves the desired effect using Flexbox:
httphttps://stackoverflow.com/a/28616083/1922441
That's a link-only-answer (redirecting to another SO answer), and thus should be flagged NAA and deleted.
As the comment says:
If the question you link is an exact duplicate, then this question should be closed as a duplicate. Otherwise, you should provide a complete answer to this question instead of a link-only answer. – josilber Aug 11 at 20:16