XML technologies / ePUB / CSS essentials / Important CSS properties / Fonts

(Excerpt from “E-Books mit ePUB ─ Von Word zum E-Book mit XML” by Dr. Victor Wang)

The table lists the main CSS properties for font display, with possible values and an example each.

font-family

Font family

Defines the font. Alongside actual font names, always specify a generic family in case the named fonts are unavailable.

Values

[[ <family-name> | <generic-family> ] [, <family-name>| <generic-family>]* ] | inherit

Example

font-family: Helvetica, Arial, Sans-Serif;

font

Font formatting

Shorthand for the combined font settings (font-style, font-variant, font-weight, font-size/line-height and font-family). Preserve this order.

Values

[ [ʼfont-styleʼ || ʼfont-variantʼ || ʼfont-weightʼ]? ʼfont-sizeʼ [/ ʼline-heightʼ]? ʼfont-familyʼ] | caption | icon | menu | message-box | small-caption | status-bar | inherit

Example

font: italic small-caps bold 9pt/10pt Geneva, Sans-Serif;

font-variant

Small capitals

Small capitals (uppercase letters) when small-caps is set.

Values

normal | small-caps | inherit

Example

font-variant: small-caps;

font-weight

Font weight

Defines text weight. In practice, only the named values (lighter, normal, bold, bolder) matter; finer numeric gradations do not occur in practice.

OPS note: readers may map numeric values from 100 to 900 to a fixed value.

Values

normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit

Example

font-weight: bold;

font-size

Font size

Font size can use CSS units or fixed values (xx-large, x-large, large, larger, medium, smaller, small, x-small, xx-small).

OPS note: readers may map measurements to a fixed value.

Values

<absolute-Größe><relative-Größe> | <Länge> | <Prozent> | inherit

Example

font-size: 11pt;

font-style

Font style

Defines the text’s font style.

OPS note: readers need not distinguish between italic and oblique.

Values

normal | italic | oblique | inherit

Example

font-style: oblique;

letter-spacing

Letter spacing

Defines spacing between individual characters. Word spacing also adjusts automatically, but can be changed with word-spacing.

Values

normal | <Länge> | inherit

Example

letter-spacing: 0.3em;

word-spacing

Word spacing

Defines word spacing without changing letter spacing (see letter-spacing).

Values

normal | <Länge> | inherit

Example

word-spacing: 2px;

   

 

 

 

back to top