Table of Contents

W3.CSS Hover Colors

  • The W3-hover-color classes define the background hover color for any HTML element.
  • The W3-hover-text-color classes define the text hover color for any HTML element.
Example
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<link rel="stylesheet" href="w3.css">
<body>
<div class="w3-container">
<h1>Hover Colors</h1>
<p>Background Hovering over an element:</p>
<div class="w3-container w3-orange w3-hover-red">
<h3>Varanasi</h3>
<p>Varanasi is the most populous city in the India.</p>
</div>
<p>Text hovering over an element:</p>
<div class="w3-container w3-orange w3-hover-text-white">
<h3>Varanasi</h3>
<p>Varanasi is the most populous city in the India.</p>
</div>
</div>
</body>
</html>