Css Links

Styles can be applied on link with different ways. There are four types of links states.

  • a:link
  • a:visited
  • a:hover
  • a:active
a {
    color: #ff9900;
} 
//we are also known this special  state as pseudo class.

a:link
This pseudo class work when link on the page are not visited means unvisited link.

a:link {
    color: # 0066FF;
} 

a: visited
This pseudo class work when link on the page are visited.

a:link {
    color: # FF3300;
}

a:hover
This pseudo class work when link on the page and move the pointer hover the link.

a:hover {
    color: # 33CC33;
}

a:active
This pseudo class work when link element is being activated by a user or user click on the link.

a:active {
    color: # FF0066;
}

We can style the link also in many ways; we can use other css properties like background, border, text-decoration etc.

a:hover {
    color: # FFFFFF;
    text-decoration:underline;
    background:#222222;
   border:1px solid #000000
}

Leave a Comment.