Remove underlines for visited and unvisited links, and specify "underline" for the hover and active link states. - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Remove underlines for visited and unvisited links, and specify "underline" for the hover and active link states.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
/* unvisited link */
a:link {
    text-decoration: none;<!--   w w  w.j av  a2 s  . com-->
}

/* visited link */
a:visited {
    text-decoration: none;
}

/* mouse over link */
a:hover {
    text-decoration: underline;
}

/* selected link */
a:active {
    text-decoration: underline;
}
</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