Prev | Current Page 135 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

Keyboard
input focus describes any element that??™s
ready to receive user input. It can apply
to a form control, for instance, or to a
link if the user navigates using the
keyboard.
Compatibility
Opera Safari Firefox Internet Explorer
9.2 3.0 2.0 1.3 2.0 1.5 1.0 7.0 6.0 5.5
Full Full Full Full Full Full Full None None None
Internet Explorer 7 and earlier versions don??™t support this pseudo-class; however,
Internet Explorer 5.5 and 6 incorrectly apply the pseudo-class :active to links that
have keyboard input focus??”a state that should be matched by this pseudo-class.
The Ultimate CSS Reference 88
:first-child
:first-child {
declaration block
}
This pseudo-class matches an element
only if it??™s the first child element of its
parent element. For instance,
li:first-child matches the first list
item in an ol or ul element. It doesn??™t
match the first child of a list item.7
For example, let??™s take the CSS selector
mentioned above:
Example
This example selector matches the first list
item in an ol or ul element:
li:first-child {
?‹® declarations
}
li:first-child {
?‹® declarations
}
And let??™s apply it to the following markup: