O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Pseudo-Classes

CSS also defines a number of pseudo-classes. Here's a sampling of pseudo-classes that can act as selectors:

  • :focus— Refers to the element with the focus (the item that is the target of keystrokes). For example, P:focus selects the <P> element with the focus.

  • :first-child— Refers to the first child of the indicated element. For example, P:first-child selects the first child of the <P> element.

  • :link :visited, :active, :hover—, Refer to hyperlink-like elements. The :link pseudo-class refers to elements that have been designated as links, :visited specifies the style of visited links, :active specifies the style of links as they're being activated, and :hover specifies the style as the mouse hovers over them.

  • :lang()— Refers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required