Using CSS Rules with XML

A CSS style sheet is made up of rules.

A rule is the association of an element type name, a class, or other part of an XML document with a CSS declaration.

If an XML document includes a title element and you want the text content to be displayed at a font size of 24 points, you could write this:

title {font-size:24pt} 

CSS Syntax

Whether it is internal (in a style element) or external, a CSS style sheet consists of rules. The following CSS rule associates the Arial font of size 36 with the h1 element:

h1 {font-family:Arial, sans-serif; 
font-size:36;} 

The part of the rule outside the curly brackets is called a

Get Sams Teach Yourself XML in 10 Minutes 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.