Previous Message
Next Message

Specifying fonts: Pixel or percentage?

Sent by Jukka K. Korpela on 5 November 2003 08:08


On Wed, 5 Nov 2003, Steve Rinaldi wrote:

> 'If the font looks too big to *you* using body, p {font-size: 100%;},then
> your* default is too big.'
>
> Now this is really a difficult one because if I do indeed specify 100% and
> make the default font 'Arial' it is just too big for windows.

Which words did you fail to understand in the sentence that you quoted?

OK, it is true that different fonts look differently sized, so that e.g.
Arial in some size looks larger than Times New Roman of the same size.
This, incidentally, is one of the reasons why Verdana should normally
_not_ be used in author style sheets. Anyway, the problem is real, and
there's really nothing we can do about it in CSS as currently defined and
implemented. What we _can_ do is to refrain from creating _new_ problems
by misguided attempts to solve this relatively small problem. - And this
problem stops being a problem on browsers that let the user select
different basic font sizes for different font groups, e.g. one size for
serif, another size (if desired) for sans-serif.

> html body, p {
>      font: 100% arial,verdana,Sans-serif;
> 	line-height: 1.5em;
> 	text-align: left;
> 	color: #000;
>      }
>
> How do you guys overcome these problems? Do you just decide you have gone as
> far as you can with MAC?

I have no idea of how MAC (whatever it means here) relates to the
problems.

But the style sheet above creates several problems:
- using Verdana (though luckily not often)
- setting the line height probably too large, and more importantly using
  the em unit which (for the line-height property specifically)
  creates nasty surprises, since it's the declared value that gets
  inherited (this line-height: 1.5 is better)
- setting text-align to left, which is the common default; this is mostly
  just pointless, but _if_ the browser for some reason has been set to
  use another alignment, this rule overrides it - and for that all we can
  know, the reason was probably a good one
- setting the color without setting background.

This being said, if you absolutely insist on trying to do something with
the problem, set
body { font-size: 90%; }
This should turn the font size to somewhat smaller and would probably
improve the situation if the browser's basic default font size has been
tuned for Times New Roman, without creating _too much_ harm when it was
actually tuned for Arial.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: