Friday, 1 May 2015

CSS Links

Links are found in every document. Links are used to click their way from one page to another page. With CSS, we can style links to make them decorative and colorful.

Styling Links

Links can be styled with any CSS property such as color, font-family, background etc. In addition, links can be styled differently depending on what state they are in.

The four link states are:
  • a:link - a normal link, or an unvisited link
  • a:visited - a link that the user had visited
  • a:hover - a link when the user mouses over it
  • a:active - a link at the moment it is clicked
For example:
a:link {color:#FF0000;}
a:visited {color:#00FF00;}
a:hover {color:#FF00FF;}
a:active {color:#0000FF;}

Text Decoration

The text-decoration property is mainly used to remove the underline from the links.

For example:
a:link {text-decoration:none;}
a:visited {text-decoration:none;}
a:hover {text-decoration:underline;}
a:active {text-decoration:underline;}

Background Color

The background-color property is used to specify background color for the links.

For example:
a:link {background-color:#0000FF;}
a:visited {background-color:#FF00FF;}
a:hover {background-color:#00FF00;}
a:active {background-color:#FF0000;}

Related Posts:

  • CSS Background CSS background property is used to define the background properties of an element. The background properties used in CSS are: background-color backg… Read More
  • Introduction to Bootstrap 3 Bootstrap 3 Bootstrap is a powerful and popular HTML, CSS, and JavaScript framework for creating responsive, mobile-first websites for faster and … Read More
  • CSS Font The CSS Font property defines the font family, boldness, size and style of the text Font The font property is used to set all the font properties i… Read More
  • JavaScript in HTML JavaScript is mainly used to manipulate the HTML elements. JavaScript gives us the full freedom to add interactivity and responsiveness to our web pa… Read More
  • HTML Lists Lists are used to order things or objects of the same category. They are used to number these objects according to a number. The most common types of… Read More

0 comments:

Post a Comment