| Microsoft Typography | Typography on the Web | Specifying fonts... | 5.2.2 'font-family' | |||||||||||||||||||||||||||||||||||||||||
|
Value: [[<family-name> | <generic-family>],]* [<family-name> | <generic-family>]
Initial: UA specific. The Internet Explorer 3.0 initial value is "Times New Roman", however this can be changed by the user under View..., Options..., General, Font Settings... Applies to: all elements Inherited: yes Percentage values: N/A Microsoft® Internet Explorer 3.0 support: partial. Microsoft Internet Explorer 4.0 support: yes. Navigator 4.0 support: yes.
There are two types of list values:
Font names containing whitespace should be quoted: BODY { font-family: "new century schoolbook", serif }
<BODY STYLE="font-family: 'My own font', fantasy">
If quoting is omitted, any whitespace characters before and after the font name are ignored and any sequence of whitespace characters inside the font name is converted to a single space.
Internet Explorer 4.0 and Navigator 4.0 seem to interpret font-family declarations in accordance with the CSS specification. Unfortunately, Internet Explorer 3.0 has various problems with font-family that often manifest themselves if the first choice font listed is not installed on the users computer. Internet Explorer 3.0 also has problems interpreting style declarations that follow font-family declarations. For this reason it's best to place a font-family declaration at the end of a list of declarations for any selector. The following table shows the fonts used by different browsers when the encounter font-family specified in a Web page. In these examples 'Bobsans' is a font not present on the users system.
Table 1. Fonts used when 'font-family' is specified in a STYLE block, linked style sheet or inline style declaration.
Note 2 Although enclosing the list of fonts in single quotes produces the desired effect in Internet Explorer 3.0, doing so contravenes the CSS spec and will not work with Netscape Navigator 4.0. Netscape 4.0 will render text in the users default font. Note 3. In addition Internet Explorer 3.0 ignores the first font listed if it is enclosed in single quotes. Here the second font listed is used. Note 4. However, if this font is also the last font listed the users default will be used by Internet Explorer 3.0. Note 5. A non-existent font name (here we've used 'X' as a font name) is enclosed in single quotes and listed as the first choice font. A non-existent font name is also listed as the last font choice (with or without quotes). This results in Internet Explorer 3.0, as well as the other browsers, interpreting the declaration properly. Advice
Dark blue text is taken from Cascading Style Sheets, level 1. W3C Recommendation 17 December 1996 - http://www.w3.org/pub/WWW/TR/REC-CSS1
|
|||||||||||||||||||||||||||||||||||||||||
| Microsoft Typography | Typography on the Web | Specifying fonts... | 5.2.2 'font-family' | |||||||||||||||||||||||||||||||||||||||||