Set font weight and color for anchor hover in HTML and CSS

Description

The following code shows how to set font weight and color for anchor hover.

Example


<!--from   w w  w.  j  ava  2s.c  o  m-->
<html>
<head>
<style>
a:hover {
font-weight:bold; color:red
}
</style>
</head>
<body>
<p>Move the mouse over the following link.</p>
<a href="http://www.java2s.com" target="_blank">
java2s.com home page link
</a>
</body>
</html>

Click to view the demo

The code above generates the following result.

Set font weight and color for anchor hover in HTML and CSS