To stop elements from overflowing outside of the container, we use the flex-wrap property.
flex-wrap
Make sure to pick flex-wrap.