HTML and CSS Reference
In-Depth Information
input[id*=phone] {} /* matches all input fields with phone as
part of the ID */
Although ID and class attributes can be selected via the attribute
selector, their more specialized selectors have been optimized by
browser vendors and should be used instead.
Pseudo-classes fall into two groups: dynamic pseudo-classes that repre-
sent a specific state the document or element is in (
visited
links) and
structural pseudo-classes that represent information about an element's
position in the document tree (the
first
list item).
Links in a document have two states. When unvisited as determined by
the browser and its document history, a link can be selected with the
:link
pseudo-class, or when visited, it can be selected via
:visited
.
a:link { color: blue; }
a:visited { color: purple; }
The three interaction states of hovering, actively being clicked or used,
and in focus can be independently styled using the
:hover
,
:active
, and
:focus
pseudo-classes.
The
:hover
pseudo-class for nonlink (
<a>
) elements is not supported
in IE6 or earlier but is supported on links as of IE4.
note