CSS Property Value How to - disabled; Disable hover effect








Question

We would like to know how to disabled; Disable hover effect.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.myElement {<!--  w  ww .j  a  v a2 s  .c om-->
  color: green;
  cursor: pointer;
}

.myElement:hover {
  color: red;
}

.myElement.disabled {
  color: green;
}
</style>
</head>
<body>
  <div class="myElement">normal</div>
  <div class="myElement disabled">disabled</div>
</body>
</html>

The code above is rendered as follows: