April 2005
Intermediate to advanced
336 pages
6h 33m
English
In this section, I'll show you how to add a little spice to your tables using background colors. So far, you've used element selectors, which relate directly to a specific HTML element, such as body, h1, p, and a. In this section, you'll add what's known as a class selector.
Class selectors are custom selectors that you give a name to; you precede that name with a dot, as in .classname. Classes are then applied to an element in the HTML using the class attribute, with a value of the class name:
<tr class="classname"> . . . </tr>
Typically, you'll want to describe the function of the class rather than the presentation. So, if you're going to apply a background color to every other table row, you'll ...
Read now
Unlock full access