We would like to know how to add hover effect to div.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.foo:hover {<!--from ww w . jav a 2s. c o m-->
color: red;
display: none;
}
</style>
</head>
<body>
<div class="foo">text</div>
</body>
</html>
The code above is rendered as follows: