untitled

(John Hannent) #1
over them, stick your made-up class name between the selector and the
pseudo-class name, like this:

a.pinklink:hover {color: pink}

Then, down in the body, refer to this class in the usual way, with a class=
attribute:

<a class=”pinklink” href=”http://www.zrsn.ori”>Click here for
a real shock.</a>

Selecting first children ......................................................................


A pseudo-class that allows you to select only the first child of an element is
also available. At the time of this writing, however, it doesn’t work in Internet
Explorer.

Say that you want to indent only the first paragraph of the body but not the
rest of the paragraphs. You can use the first-child pseudo-class, like this:

body > p:first-child
{
text-indent:30px;
}

Then, later in the body:

<p>
This first paragraph is indented, yes?
</p>

<p>
But this second paragraph isn’t indented.
</p>

Employing Fake Pseudo-Elements ............................................................


Guess what? The CSS folks have come up with another category of pseudo
called the pseudo-element. But who cares? I can see no distinction between
pseudo-classes and pseudo-elements, although I’ve read and researched and
pondered. W3.org “explains” the distinction here:

http://www.w3.org/TR/REC-CSS2/selector.html#q15

If you have any idea what they’re talking about, please email me at
[email protected]. Perhaps the wise guys who make up these
systems and taxonomies can provide some clarification. But do you really

Chapter 15: CSS Moves into the Future 273

Free download pdf