Forum Moderators: not2easy

Message Too Old, No Replies

Best practices for relative font sizing

looking for up to date information

         

Clark

1:09 am on Apr 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've read so many articles on relative font sizing and changed my mind so many times on how to set up my css to allow ie6 users to change the text size and after all that, I'm just confused and frustrated.

So what's the best, most practical way to go? Ems? Percentages? Do you set a base size for body?

Looking for input from the pros. Thanks.

Xapti

1:45 am on Apr 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



body{font-size:100%} fixes an ie6 bug where things may not increase by a proper scale. Other than that, I personally find the best accessibility is to not specify a font size, using the browser's default as the main value.

From there, you can make certain text larger or smaller - such as headers 1.6 em to 1.1em, navigation 1.1 or 1.2 em, footer text 0.6 to 0.8 em, hover pop-up div text ~0.7 em, notice messages 0.8 - 1em, etc. These are just examples of course.

I personally dislike the way people use base their base/body font size as .8 em... you're taking the font size one should assume the user is comfortable with, and then shrinking it by a factor of 25%.

There is very little difference between percentage and ems, but there may be certain reasons why you would want to use one, due to the fact they are affected by cascading differently.

As you probably know, pixels don't resize in Internet Explorer, nor do point/pica/inches/centimeter, which is not good for accessibility. Not only do pixels not resize under IE6, but no matter the browser, pixel base sized text can be too large at small resolutions, and too small at high resolutions. Points have a similar problem, although it can be corrected using DPI correction (which most peopel dont' do though). Depending on the page design, you may want to set the printing style sheet with physical measurements like inches and points though.

One last footnote to keep in mind, as you are probably aware, not all font faces are the same size. Unfortunately, there's not a whole lot one can effectively do about it, but if you are sizing containers to fit without line wrapping, you may need to be careful and add a bit extra space.

[edited by: Xapti at 1:50 am (utc) on April 15, 2008]

Clark

1:59 am on Apr 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Xapti,

Per Suzy's suggestion, I am making an ie only stylesheet. I guess I can stick that rule in the ie only sheet, and if so, do I target ie6 only?

Also, does that rule change the H1/H2..etc... headers? Meaning I'll have to manually set those?

Xapti

3:19 am on Apr 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



well it's kind of a redundant setting, since it should not affect any other browser adversely, but if you have an IE6 sheet on it's own, that should work fine, yes. It does not change anything else as far as I know, it just sets the base as 100%, since headers by default size relatively (as far as I know), it shouldn't be an issue.