What do you all use for sizing - font and borders and such?
Printable View
What do you all use for sizing - font and borders and such?
We have a web designer for us now, so I haven't done CSS in ages, but I typically used em for fonts and pixels for everything else.
Usually it's a consideration of what is layout (and what kind of layout) vs content. If I haven't made a "liquid" layout (one that will self-adjust to text size changes), then I don't want a site to look broken because someone upped their font size. So in that case, layout elements will likely be pixels.
For content font, I use a variation of what is discussed in this article: use a percentage as the initial size value, and then ems for the rest.
I use ems and px for padding, px for margins, px for borders, px for widths and heights, and neither for font sizing (I use xx-small, x-small, small, medium, large, x-large, and xx-large :))
em, because px is derived from em. The only reason to use px is when doing absolute positioning (e.g. floating elements with JS).
This is less of a problem with modern browsers because they all tend to scale elements now rather than simply increase text size.
I use px each time the size of the element must be related to a background image. This avoids having a broken layout. Things may change with multiple background images, haven't played around with them a whole lot yet.