CIT041X Index > Cascading Style Sheets

Style Sheets

Read Chapter 13 in XML: The Complete Reference; there are only a few things to add to the discussion in the book.

See examples of stylesheets in action.

Given this selector:

planet[atmosphere="breathable"]
{
   color: green;
}

The first <planet> element will appear in green; the second one won't. In neither case will the value of the attribute (breathable or poisonous) appear on the screen, nor can it easily be made to do so with Cascading Style Sheets. This makes CSS much more appropriate for narrative-oriented markup such as XHTML rather than data-oriented markup such as the catalog or wrestling club database.

<planet atmosphere="breathable">Earth</planet>
<planet atmosphere="poisonous">Jupiter</planet>

The first example in the Position section on page 121 should read:

para:first-child { text-transform: uppercase; }

In the discussion of The display Property on page 125, the value of invisible should be none. An element with a display value of none is taken completely out of the flow; its content never appears on the screen at all. This is as opposed to visibility: hidden, which keeps the item in the flow but doesn't show it. Such an element will “leave a blank space” where it would ordinarily have appeared.

The color values of lime and green are reversed in the table on page 135. lime is a fully saturated green; green is a darker shade that is much easier on your eyes.