Forum Moderators: open
Have a look at this CSS Forum thread [webmasterworld.com] which should hopefully answer your question.
I use two approaches, each with their merits. The first is to use font size keywords:
h1 {font-size:large;}
h2 {font-size:medium;}
p {font-size:small;}
#footer {font-size:x-small;} Sizes run from xx-small to xx-large. There are two disadvantages to the keywords approach, the first is that you are limited to seven levels and the second is that IE5 (or IE6 in quirks mode) will make the fonts one size larger unless you use a box model hack. I don't bother these days as I have very few IE5 users and it is not a problem that the text is larger for them anyway.
The second approach is with percentages and ems:
body {font-size:100%;}
h1 {font-size:1.5em;}
h2 {font-size:1.1em;}
p {font-size:0.9em;}
#footer {font-size:0.7em;} The disadvantage is that if you get to 0.5em or lower then IE tends to act a bit strangely.
Assuming your documents are always in standards-compliance mode (with a full doctype on the very first line) then font size without pixels works very well.
Assuming your documents are always in standards-compliance mode (with a full doctype on the very first line) then font size without pixels works very well.
Oh, lordy. You are talking to someone who hand codes her HTML and CSS. I've always gone with the idea that if it works use it.
I just asked about doctypes on the HTML forum. Maybe I can sort it out. I've tried to validate my pages before but they always want a doctype. I don't think they had those back when I learned HTML.
I'll try your suggestions on a small subsection. I have a couple that are on their own stylesheet. Then it will be easier to see if it works.