CSS Working with Links

free php tutorials, php classes, php utilities, free tools

Using Links user can visit different pages and files. Both text and images are able to be used as a link source. In CSS you can define different styles for link. In CSS links has four differnet follow states :

  • a:link Defines a Normal unvisited link
  • a:visited specifies Visited Links
  • a:hover defines hovered links (A link is hovered when mouse moves over it).
  • a:active Specifies active it ( A link becomes active once you click on it)

Example

<style type="text/css">
a:link{
color:blue;
font-family:arial;
font-size:12px
}
a:hover{
color:blue;
font-family:arial;
font-size:12px
}
a:visited{
color:black;
font-family:arial;
font-size:12px
} </style>
<a href="#">Check this Example</a>

Removing Undeline from a link:
Using CSS, you can remove underline from alink using (text-decoration:none), see this example

<style type="text/css">
a:link{
color:red;
font-family:arial;
font-size:12px;
text-decoration:none;
}

a:hover{
color:blue;
font-family:arial;
font-size:12px;
text-decoration:underline;
}
a:visited{
color:black;
font-family:arial;
font-size:12px;
text-decoration:none;
}
</style>

<a href="#">Check this Example</a>

Bookmark This Page