XML technologies / DocBook / Generating (X)HTML / Formatting (X)HTML with CSS / A short introduction to CSS

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

A CSS rule consists of two parts: a selector and a declaration. The selector determines which element the style applies to. The declaration consists of one or more property–value pairs (see the following example).

Example: Syntax of a CSS rule

Selektor
{
  Eigenschaft-1: Wert-1; \
  ...                    | Deklaration
  Eigenschaft-n: Wert-n; /
}

The following CSS rule formats all h2 elements in bold with a large font:

h2 {
  font-size: large;
  font-weight: bold;
}

  

back to top