Set the color for unvisited links to "red", and the color for visited links "blue". - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Set the color for unvisited links to "red", and the color for visited links "blue".

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
/* unvisited link */
a:link {
    color: red;
}

/* visited link */
a:visited {<!--  ww  w.ja  v a2s.com-->
    color: blue;
}

/* mouse over link */
a:hover {
    color: black;
}

/* selected link */
a:active {
    color: green;
}
</style>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p><a href="http://java2s.com">java2s.com</a></p>

</body>
</html>

Related Tutorials