Monday, 27 June 2011

CSS Pseudo-classes


CSS pseudo-classes are used to add special effects to some selectors.
A pseudo-class starts with a colon (:). No whitespace may appear between a type selector or universal selector and the colon, nor can whitespace appear after the colon.
Syntax:
selector:pseudo-class {property:value;}
selector.class:pseudo-class {property:value;}
Ex:
a:link {color:#FF0000;}                /* unvisited link */
a:visited {color:#00FF00;}  /* visited link */
a:hover {color:#FF00FF;}            /* mouse over link */
a:active {color:#0000FF;}            /* selected link */

No comments:

Post a Comment