Here is an example of how to change an image on hover using CSS:

HTML:

<div class="image-container">
  <img class="normal" src="image1.jpg" alt="image1">
  <img class="hover" src="image2.jpg" alt="image2">
</div>

CSS:

.image-container {
  position: relative;
}
.image-container img {
  display: block;
  width: 100%;
}
.image-container img.hover {
  display: none;
}
.image-container:hover img.normal {
  display: none;
}
.image-container:hover img.hover {
  display: block;
}

In this example, the .image-container class is used to create a container for the images. The img.normal and img.hover classes are used to specify the normal and hover images respectively. The :hover pseudo-class is used to change the display property of the images when the container is hovered over.

Also Read:

Categorized in: