Linked by Thom Holwerda on Sun 5th Oct 2008 15:57 UTC
Thread beginning with comment 332522
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[7]: Comment by sbergman27
by google_ninja on Mon 6th Oct 2008 01:53
in reply to "RE[6]: Comment by sbergman27"
Absolute values like px or pt overwrite inherited values, yes. But em is a relative value. It is dependent on the inherited font size (1em == the width of letter 'm'). Therefor, indeed another shrink happens, as sbergman assumed.
You learn something new every day
I didn't realize that, and I fancy myself pretty good at css. I also want to add that px is not, as you claim, the right unit for font sizes, even if you want to give a fixed font size. You should instead use pt, which at least (while not following the user's preference for base font size) respects the screen's DPI.
The only problem with pt is if you are not using ubiquitous fonts like Arial or Helvetica. When the user fails over to another font, you could end up with a dramatically different looking page then what you want, as some fonts are bigger then others at the same pt.
This is all pretty academic anyways, since em is the correct unit in the overwhelming majority of cases. I would say though that in the odd case where you do need to override the users choices, chances are you will want to override their dpi choice too.






Member since:
2006-01-16
You are not completely right here.
Absolute values like px or pt overwrite inherited values, yes. But em is a relative value. It is dependent on the inherited font size (1em == the width of letter 'm'). Therefor, indeed another shrink happens, as sbergman assumed.
I also want to add that px is not, as you claim, the right unit for font sizes, even if you want to give a fixed font size. You should instead use pt, which at least (while not following the user's preference for base font size) respects the screen's DPI.