Skip to content

Instantly share code, notes, and snippets.

@JeffAspen
Created November 16, 2015 18:22
Show Gist options
  • Save JeffAspen/3d0b81ee4c1a5054694c to your computer and use it in GitHub Desktop.
Save JeffAspen/3d0b81ee4c1a5054694c to your computer and use it in GitHub Desktop.
CSS Image Swap
<div class="hover_effect">
<img src="PATH-TO-FIRST-IMAGE" class="first">
<img src="PATH-TO-SECOND-IMAGE" class="second>
</div>
<style type="text/css" media="screen">
.hover_effect .second {
display: none;
}
.hover_effect:hover .first {
display: none;
}
.hover_effect:hover .second {
display: block;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment