link and visited Selector

link and visited Selector
CSS link and visited Selector reference
The CSS link selector ( X:link() { } ) and visited selector ( X:visited() { } ) are used to target and style link elements according to whether or not the user has visited the link destination already. Browser software will usually set visited links to a different color and these selectors allow you to specify styles for this logic.
CSS CODE EXAMPLE
<!DOCTYPE html>
<style type="text/css">
a:link {
    color:#900;
}
a:visited {
    color:#CCC;
}
</style>
<ul>
  <li><a href="#x">Home</a></li>
  <li><a href="#y">Services</a></li>
  <li><a href="#z">Contact</a></li>
</ul>
Demo Hint: To see the effect of this start clicking my links below. Each time you visit a destination the link will change appearance.
 

0 Response to "link and visited Selector"

Post a Comment