How can I center the second element in a div without knowing the width of the first.
I want “foo” to float to the left and “bar” to be centered in the original div. I can do this if I know the width of “foo”:
<div>
<span style="float:left;">foo</span>
<span style="margin-left:-10px;">bar</span>
</div>
Is there another way to do this, without margin-left set to a static width?
Center of the parent div?
CSS: