CIS 97YT Index > Cascading Style Sheets

Style Sheets

Read Chapter 4 in Learning XML; there are only a few things to add to the discussion in the book.

See examples of stylesheets in action.

On page 116, the book says that “CSS selector syntax is limited to element names, attributes, and element content.” Though you can determine which elements will have a particular visual presentation dependent upon an attribute's value, you can not extract that value and show it.

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.