Creating Style Rules

We've seen how to create selectors in rules; it's time to take a look at creating rules themselves. A rule is composed of a selector followed by a semicolon-separated list of property-value pairs enclosed in curly braces, like this:

TITLE {display: block; font-size: 24pt; font-weight: bold;
text-align: center; text-decoration: underline}

In this case, I'm setting values for the display, font-size, font-weight, text-align, and text-decoration properties. You assign a value to a property by following the name of the property with a colon, whitespace, and the value that you want to assign.

Quite a number of properties are defined in CSS, and the best way to get a grip on what's going on is to actually use them, so we're about ...

Get Inside XML now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.