I have a flex container with justify-content: flex-start. There ends up being overflow on the right side due to the flex items taking less space than the size o
justify-content: flex-start
This one worked for me on the same inline-flex (or flex) element:
width: fit-content;