I am attempting to center a group of floating elements, but due to them being displayed in masonry style, I cannot set them as inline
. It is clear that a container is necessary, but I have been unable to find information on how to achieve this:
Please disregard the margins shown here, they are irrelevant and just help distinguish each individual child element. While the parent element may not be centered currently, it has the potential to be aligned. The crucial aspect is for it to dynamically accommodate the child elements without constantly spanning 100% of its width.
At one point, I experimented with making the parent element float, however this resulted in the child elements stacking into a single column.