| Microsoft Typography | Typography on the Web | Specifying fonts... | 5.2.7 'font' | |||
|
Value: [ <font-style> || <font-variant> ||
<font-weight> ]? <font-size> [ / <line-height> ]?
<font-family>
Initial: not defined for shorthand properties Applies to: all elements Inherited: yes Percentage values: allowed on <font-size> and <line-height> Microsoft® Internet Explorer 3.0 support: partial. Microsoft Internet Explorer 4.0 support: yes.
For a definition of allowed and initial values, see the previously defined properties. Properties for which no values are given are set to their initial value. P { font: 12pt/14pt sans-serif }
P { font: 80% sans-serif }
P { font: x-large/110% "new century schoolbook", serif }
P { font: bold italic large Palatino, serif }
P { font: normal small-caps 120%/120% fantasy }
In the second rule, the font size percentage value ('80%') refers to the font size of the parent element. In the third rule, the line height percentage refers to the font size of the element itself. In the first three rules above, the 'font-style', 'font-variant' and 'font-weight' are not explicitly mentioned, which means they are all three set to their initial value ('normal'). The fourth rule sets the 'font-weight' to 'bold', the 'font-style' to 'italic' and implicitly sets 'font-variant' to 'normal'. The fifth rule sets the 'font-variant' ('small-caps'), the 'font-size' (120% of the parent's font), the 'line-height' (120% times the font size) and the 'font-family' ('fantasy'). It follows that the keyword 'normal' applies to the two remaining properties: 'font-style' and 'font-weight'.
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.7 'font' | |||