We would like to know how to toggle the opacity of LI Elements.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
ul:hover li {<!-- w ww . ja v a 2 s. co m-->
opacity: 0.5;
}
ul li:hover {
opacity: 1;
}
</style>
</head>
<body>
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
<li>D</li>
<li>E</li>
</ul>
</body>
</html>
The code above is rendered as follows: