IMG-LOGO

CSS Links

andy - 06 Aug, 2013 3520 Views 0 Comment

In CSS, you have 4 available properties to define the states of hyperlinks.

Property Name Description Example
a:active A link will become active when you click on the link.
a:active {color:yellow}
a:link Apply to all links that are not visited yet
a:link {text-decoration:none;}
a:visited Apply to links that have been clicked or visited.
a:visited {color:red}
a:hover Apply the action, when you hover your mouse over the links.
a:hover {text-decoration:underline;}

Examples

Please see the following quick examples on how each link state is used.

CSS Style Result
a:link{
    color:blue;
    text-decoration:none;
    font-weight:normal;
}

a:hover{
	color:red;
	text-decoration:underline;
}

a:visited{
	text-decoration:underline;
	color:green;
}

a:active{
	font-weight:bold;
	color:#black;
}
Click here

Comments

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.

Related Blogs

How to style pagination links with CSS?

Do you need to create a beautiful, simple and elegant pagination links with css? Simply follow our easy and quick tutorial on how to create the pagination links easily with CSS.

Optimizing your site for printing

The easy way to optimize your site for printing is to create a separated external css targeting a media to print only When a printing action is being executed the browser will send over the information from your page to ...

Related Tutorials

CSS Z-Index

z-index is a css property that allows to position an object/element in front/behind of other elements.

What is CSS?

CSS stands for Cascading Style Sheet and is used to define of how the html elements displayed.