Check out example codes for "play gif on hover css". It will help you in understanding the concepts better.

Code Example 1

<!-- HTML -->
<img class="static" src="https://lh4.googleusercontent.com/-gZiu96oTuu4/Uag5oWLQHfI/AAAAAAAABSE/pl1W8n91hH0/w140-h165-no/Homer-Static.png">

<img class="active" src="https://lh4.googleusercontent.com/i1RprwcvxhbN2TAMunNxS4RiNVT0DvlD9FNQCvPFuJ0=w140-h165-no">

<!-- CSS -->
<style>
  .static {
    position: absolute;
    background: white;
  }

  .static:hover {
    opacity: 0;
  }
</style>

Learn ReactJs, React Native from akashmittal.com