I am searching for a way to display/play a gif inside of a button. The button should have a gif inside it, that starts playing on hover.
Asked
Active
Viewed 571 times
-1
-
1Does this answer your question? [Can you control GIF animation with Javascript?](https://stackoverflow.com/questions/2385203/can-you-control-gif-animation-with-javascript) – zero298 Jun 01 '20 at 20:21
1 Answers
0
Well, you need to use CSS
<style>
.button {
background: url('gifname.gif');
border: none;
background-repeat: no-repeat;
object-fit: cover;
}
</style>
<button class="button">
I hope that solves your problem

RingGamesCompany
- 153
- 1
- 9
-
Tried it, but didnt get it to work :/ Do you have a jsbin or codepen link? – WakanaYuki Jun 02 '20 at 17:31