Wow, this problem is popular. It's based on a misunderstanding in the vertical-align property. This excellent article explains it:

Solutions 1 (flex + justify-content) and 3 only align vertically to the center, content is still aligned to the right. Solution 2 (flex, margin: Auto) works but it makes the scrollbar appear as if content was sightly …