I am trying to figure out how to center the second element in a div without knowing the width of the first one.
My aim is to have "foo" align to the left and "bar" centered within the original div. I have managed to achieve this by setting a static width for "foo":
<div>
<span style="float:left;">foo</span>
<span style="margin-left:-10px;">bar</span>
</div>
Is there an alternative method to accomplish this, without relying on a specific margin-left width?