HTML Element Style How to - Style Select Active Menu Item Differently on Hover








Question

We would like to know how to style Select Active Menu Item Differently on Hover.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.menu-tabbed-horiz .current a:hover {<!--   w ww  .  j a  v a 2 s .  c o m-->
  color: #EEE;
}

.menu-tabbed-horiz a:hover {
  color: #AAA;
}
</style>
</head>
<body>
  <ul class="menu-tabbed-horiz">
    <li class="item-435 current active parent"><a class="firstmenuitem" href="">Home</a></li>
    <li class="item-467"><a href="">Menu 2</a></li>
    <li class="item-468"><a href="">Menu3</a></li>
  </ul>
</body>
</html>

The code above is rendered as follows: