Take a look at the following script https://jsfiddle.net/27x7rvx6
CSS ( #test is the #test container, and .items are its children):
#test { display: flex; flex-flow: row nowrap; justify-content: center; width: 300px; margin-left: 150px; border: 2px solid red; } .item { flex: 0 0 70px; margin-right: 10px; background: blue; height: 70px; border: 2px solid black; }
There is one row ( nowrap ) of flexbox with fixed-size elements. The justify-content container is set to center . Since the elements cannot shrink and be wider than the container, they begin to overflow.
My problem is that the content overflows both left and right. Is there a way to make the object warranted to center, but as soon as it starts to overflow, it acts as if the justify-content property is set to flex-start , respectively. do overflow just to the right of the container?
source share