[thelist] interesting CSS syntax

Bill Mason data at data1701d.com
Wed Jun 13 16:26:02 CDT 2001


The first X works around an IE3 bug where if you have a font-family list 
and the browser doesn't have the first font in the list available to it, it 
will ignore all the fonts in the family list -- regardless of whether any 
of the other fonts are available to the browser or not.

I have no idea why you would need to end the font-family list with another 
X, though.

At 02:13 PM 6/13/01, Canfield, Joe wrote:
>I'm reading the CSS1 spec right now, and I don't get how putting a fake font
>name first and last will make it cross browser.
>
> >.more
> >    {
> >    font-size: 8pt;
> >    font-family: 'X', sans-serif, arial, helvetica, verdana 'X';
> >    }
> >
> >
> >What does the 'X' do?
>
>It looks like a fake font name to compensate for some browser quirks. A
>selection from the
>"note" section of their CSS file reads:
>
>"NOTES:
>       for font-family, several alternative fonts are specified,
>       followed finally by a supported generic family name
>       ('serif', 'sans-serif', 'cursive', 'fantasy').
>
>       Place the font-family declaration at the end of the list of
>       declarations for a selector to account for an MSIE3 font
>       declaration freak out
>
>       For correct rendering across all three browsers include a
>       fictitious font name enclosed in single quotes as your
>       first font choice and a fictitious font name as your last
>       choice. "
>
>Since the X is fake, it would go to the next available font - the default
>sans-serif for
>that machine, in your case it would be Lucida!


Bill Mason
data at data1701d.com
Dateline: Starfleet
http://www.data1701d.com
http://profile.guru.com/billmason





More information about the thelist mailing list