CSS Measurements
Some CSS tutorials say the px is an absolute measurement while others say that it relative. So my question is which is it and why the confusion?
Also would it be better to use px or em when specifying font size? Many say that you should use em but to me it seems more complicated and easier to get stuff messed up on a page because its size is determined by the things around it. Thanks.
demonhale posted this at 03:34 — 7th April 2007.
He has: 3,278 posts
Joined: May 2005
I use px to specify container widths, heights, paddings, margins... almost always ems for font sizes...
kazimmerman posted this at 14:54 — 8th April 2007.
He has: 698 posts
Joined: Jul 2005
Well, if you use absolute measurements, which I believe px is, to determine the size of different containers and images, then using em for text sizes will allow the text to appear in the same ratio in all browsers to the things around it. If you use pixels, the text will appear smaller in larger resolution monitors and very large in the smaller-res monitors.
Kurtis
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.