CSS -- Font Properties


PropriétésValeur
Valeur initialeAppliquée àHéritéevaleur %
'font-family'[[<family-name> | <generic-family>],]*[<family-name> | <generic-family>]
UA specificall elementsouiN/A
<family-name>Le nom de la police de votre choix.
<generic-family>'serif' (Times)
'sans-serif' (Helvetica)
'cursive' (Zapf-Chancery)
'fantasy' (Werstern)
'monospace' (Courier)
'font-style'normal | italic | oblique
'font-variant'normal | small-caps
'font-weight'normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
normalall elementsouiN/A
'font-size'<absolute-size> | <relative-size> | <length> | <percentage>
mediumall elementsouirelative to parent element's font size
<absolute-size>[ xx-small | x-small | small | medium | large | x-large | xx-large ]
<relative-size>[ larger | smaller ]
'font'[ <font-style> || <font-variant> || <font-weight> ]? <font-size> [ / <line-height> ]? <font-family>
not defined for shorthand propertiesall elementsouiallowed on <font-size> and <line-height>

font-family: "font1, font2, ..., fontFamily"
Defines the font of the text. If font1 isn't available in the system, font2 will be used, and so on. Finally you should define one or many font families, which tells the browser how the font should be displayed. For example, if the monospaced font you've defined doesn't exist, adding "monospace" will display another monospaced font instead of the standard font. fontFamily can be either sans-serif, serif, cursive, fantasy or monoscape.

font-style: normal|italic|oblique
Defines the style of the text.

font-variant: normal|small-caps

font-weight: normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
Defines the weight, boldness, of the text. weight can be, for example, light, extra-light, demi-light, bold, extra-bold, demi-bold or medium.

font-size: n
The size of the text. n is a number followed by either "px" (for pixels), "in" (for inches), "pt" (for points) or "cm" (for centimeters), for example "10pt".


Christophe Merlet
redfox@redfoxcenter.org
©Tous droits réservés
11 août 1997