Format overview

The CSS format utilizes the ASCII text format, so style definitions can be easily created and edited in any text editor or word processor. However, unlike XSL, it does not use XML constructs.

Rules

A CSS stylesheet is composed of at least one style rule. A rule is simply a style specification for an element, pseudo-element or group of similar elements. A typical stylesheet will contain many such rules.

A rule begins with a selector, which must start a new line in the text file. In the simplest case, the selector is the name of an XML or HTML element. In the following example, the selector is 'title', so the style definition will apply to the content of the Title element, wherever it is used in a document. Curly brackets enclose ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.