Flexbox can be used to justify items inside a parent container.

To see how it works, press the buttons and use the slider to change the width of the parent container.