Pseudo Classes in CSS

Pseudo Classes in CSS

Anchor Pseudo Classes

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 */

Other Pseudo Classes

input:focus {background-color:#0000FF;}  /* background color change on focus */

p:first-letter {font-size:20px;} /* make first letter size large */

p:first-line {font-weight:bold;} /* make first line bold */

p:first-child {text-decoration:underline; } /* making first child of paragraph tag underline */

p:before {color: #cc000;} /* make paragraph with #cc0000 which is before */

p:after {color:#cc0000;} /* make paragraph with #cc0000 which is after */