If you mean you want the container to be the width of the items, rather than the items expanding to the container width…
You may be able to get that by changing display:flex to display:inline-flex
If you mean you want the container to be the width of the items, rather than the items expanding to the container width…
You may be able to get that by changing display:flex to display:inline-flex