While many questions address similar issues, the focus is always on having all items centered (accomplished by using display:inline-block
). However, my requirement is to have the last line of items floated neatly left and only center the container itself (located in a variable container - the body).
The challenge lies in getting the container to take the width of the containing floated elements, regardless of setting display
or clear
. It seems like a simple task, yet I'm struggling to make it work.
Feel free to check out this basic fiddle to experiment with the scenario.