untitled

(John Hannent) #1
at this time, IE isn’t supporting many of the newer pseudo-classes, so you
have to essentially avoid these latest pseudo features. Nonetheless, such fea-
tures as the four pseudo-classes that work with hyperlinks (described earlier
in this chapter) are quite useful and work well within IE.

Based on the information in “drafts” floating down from the white towers on
the hill where CSS specifications are dreamed up, you can look forward to at
least some of the pseudo features in the next two sections making their
appearance in CSS in the coming years.

Enabling, disabling ............................................................................


The :enabledand :disabledpseudo-classes allow you to apply the tradi-
tional visual cues to such input controls as check boxes, radio buttons, and
so on. When elements in Windows are disabled(meaning that the user cannot
interact with the control), for example, it’s a convention to turn the control
light gray. This lets people know that the control is inert. One use for such a
feature is if the user is filling in a form and clicks the Never Married check
box. At this point, you would have your Web page disable the How Long Have
You Been Married? check box. There would be no reason to permit the user
to enter information about how long he or she had been married, if he or she
had never been married, right?

Checking radio buttons and check boxes ......................................


The :checkedand :indeterminatepseudo-classes provide a style (usually
a vibrant color) that indicates the status of a check box. In general, the con-
vention in Windows has been to merely display a check symbol rather than,
say, highlight the text associated with a check box or radio button (instead of
a check, a selected radio button control gets a dot). Indeterminateworks
only with the radio button. It has a three-state property: enabled(called
checked by CSS), disabled, and indeterminate. The checked class works
with both radio buttons and check boxes.

I suggest you forget about these button and check box pseudo-classes unless
you have some strange requirements for your user input. Just let the controls
do their thing automatically: visually cueing the user with dots or checks when
the control is clicked. Anything that you add by using a style is probably
overkill and violates the visual conventions of Windows. Violating conventions
often simply confuses and annoys people who, over the years, have gotten
used to the way things work in Windows. Nonetheless, some of the worker
bees at Microsoft sometimes decide that they know best and come up with
bizarre modifications that confound the rest of us. Try, for example, to find
the menus in Windows Media Player version 10. The usual File, Options,
Tools, and Help menus at the top left of almost every Windows application

276 Part IV: Advanced CSS Techniques

Free download pdf