Re: CSS2 & the <TT> ,, </TT> font. It's not monospaced

"Eric A. Meyer" wrote:

> >My browser is configured to use the fixed width font
> > Andale Mono. When I specified Font-Family : monospace,
> > the lists displayed in a different font.
> >Maybe it is a Netscape problem. I have absolutely no idea
> > what a CSS2 monospaced font really is. A fixed width font
> > is the font I tell the browser to use in the "Appearance
> > / Fonts / Fixed Width Font" font selector menu.
>
>    CSS relies on the browser to tell it what a "monospace" font is, since
> different systems will have different fonts available.  A well-designed
> browser would have reported Andale Mono, since that's what you had set in
> your preferences, but Netscape's CSS implementation is not well-designed.

Netscape 4.x used a hard coded font for 'monospace', the new Netscape layout
engine (Gecko, formerly known as Raptor), will use the fixed font from the user
preferences.

> >The main point is : CSS2 can't (check that) emulate
> > the <TT> font, so maybe another CSS tag is needed.
>
>    Yes, it can, and does.  For example, the following rules will cause the
> two types of elements to look the same:
>
>    TT {font-family: monospace;}
>    SPAN.fixed {font-family: monospace;}
>

Copied directly from the Gecko User Agent style sheet:
tt, code, kbd, samp {
  font-family: monospace;
}

So, yes, it works just fine given an engine that handles CSS properly.

Peter

Received on Friday, 28 May 1999 12:51:16 UTC