1/*To fix this problem use flexbox auto margins, instead of justify-content.
2
3With auto margins, an overflowing flex item can be vertically and horizontally centered without losing access to any part of it.
4
5So instead of this code on the flex container:
6*/
7
8#flex-container {
9 align-items: center;
10 justify-content: center;
11}
12/*Use this code on the flex item:*/
13
14.flex-item {
15 margin: auto;
16}