On Sun, Sep 16, 2007 at 01:32:13AM +0100, Greg Thomas wrote:
On 15/09/2007, Chris G cl@isbd.net wrote:
The question is basically - what do they actually mean?
There are four ways to set a font size using CSS.
An "absolute size" is one of xx-small, x-small, small, medium, large, x-large, xx-large. Despite the name, these are relative to the browsers default font size, but absolute to that browser config - i.e. a "font-size: small" will be the same size wherever it appears on your page. Typically each step in/decreasing by 20% IIRC from "medium".
The browser's default font size being the one set in 'preferences' or wherever presumably? I.e. I have my default font in Firefox set to Sans Serif size 14 so that means that all font sizes set in what CSS calls 'absolute' will be a fixed amount smaller or larger than my default 14 pt.
A "relative size" is "smaller" or "larger" (again, 20% IIRC). This is relative to the inherited font size for that element.
A "percentage size" is a percentage of the inherited font size, so font-size: 80% is equivalent to font-size: smaller, though there are (were?) some nasties with different browsers in this area (different browsers have different definitions as to what the size is a percentage of, though things may be better nowadays).
What is the 'inherited' font size? I think this is the essential bit that I haven't grasped yet.
[snip detailed further explanation, thank you]
One last thing: always always always validate your CSS - the Web Developer Toolbar for Firefox allows you to do that at the click of a button (you'll need the "Validate local CSS/HTML" option if you're behind a firewall).
I have the Web Developer Toolbar installed already.
Thanks for taking so much trouble to answer my rambling questions.