How I want it to look: https://i.stack.imgur.com/LgfnJ.png
Please note: Setting a fixed width is not useful here, because that would prevent the boxes from using all available screen space. I need the boxes to stay responsive, but want them to appear centered.
The problem is not so much the centering of the element, but the fact that the element takes up 100% width when it doesn't need to.
I have a container with several boxes, which are set to float.
<div id="contentBox">
<a class="content"></a>
<a class="content"></a>
<a class="content"></a>
<a class="content"></a>
<a class="content"></a>
<a class="content"></a>
<a class="content"></a>
<a class="content"></a>
<a class="content"></a>
</div>
The container div takes up 100% width, even if it doesn't require it all, so I can't get it centered with margin: 0 auto.
How do I get the container to not needlessly take up 100% width?