If you use floats, you pretty much need to give them widths. Floats are fine if you specify the width or you're happy with whatever the browser calculates as the minimum required width. As soon as yo uneed them to expand to fill available space you're out of luck.
In fact you're then using the wrong tool.
So you have two possibilities:
- Fix the size of the floats; or
- Use a table.
With tables this is a trvial problem to solve (waits for the anti-table pure-CSS fanatics to go nuts).
EDIT: Ok, you want to do verticall centering as well. Now you're really in trouble. See Can you do this HTML layout without using tables? for how hard even simple layout can be with pure CSS, particularly when you want to do vertical centering (when the container or the child aren't fixed height) or side by side content.
Again, tables make this trivial with vertical-align: middle
.
If you want more information on vertical centering with pure CSS, see:
- Vertical Centering in CSS: three levels of nested divs... just to get vertical centering;
- How to: vertical centering with CSS; and
- Vertical centering with CSS.