In this lesson we will style links using CSS.
A link can have four different states.
Unvisited, visited, hover and active.
Knowing this is important because we need to define a style rule for each state.
Our html page here shows an example of how this is done.
/* unvisited link */
/* visited link */
/* mouse over link */
/* selected link */
<p><b><a href="#" target="_blank">Sample Link</a></b></p>
To identify a link we start with the a property followed by a colon (:).
Next we specify the state.
We've started with just the default state, link. We've set the color to red with no text-decoration.
The visited link has a color rule set to blue.
The hover link has a color rule set to purple as well as a text-decoration rule set to underline. The background will also change to yellow on hover.
When the link is clicked, the active property will change the link color to blue.