I have a wrapper of certain width. I want to float 3 boxes inside that wrapper. What unit should I specify the size of the boxes in — px
, em
or %
?
views:
44answers:
3
+1
A:
If the wrapper has a certain (fixed?) width, then percentages would be the right way (assuming that the height of the 3 boxes may vary). Otherwise, when using em values, the 3 boxes won't fit into the wrapper side by side if the user enlarges font sizes via the browser.
Paul
2010-05-04 08:05:56
If of course the wrapper has _always_ the same width, you may also use pixel widths for the 3 boxes.
Paul
2010-05-04 08:07:05
A:
Using percentages will probably give you rounding issues, so use whatever unit you used the set the "certain width" of the container (and if you used percentages for that, you'll have to live with the rounding issues).
David Dorward
2010-05-04 08:12:50