1

Is there a way to display a gif in HTML 5? I've tried this code, and it doesn't work (images work though)

<img src="loading.gif">

I've spent hours trying to find out how to do this, thanks!

TardiCoder
  • 17
  • 1
  • 7

1 Answers1

1

The reference to your image is incomplete since your code itself is fine.

Your code reads as: the image is located at http://example.com/loading.gif.

You need to either put the complete url path (https://media.giphy.com/media/jUwpNzg9IcyrK/giphy.gif or use ellipses (../media/giphy.gif) to go back a directory.

<img src="https://media.giphy.com/media/jUwpNzg9IcyrK/giphy.gif">
Mech
  • 3,952
  • 2
  • 14
  • 25
  • Ok thank you, for some reason the URL I had tried was faulty-even though I copied the link using the "copy link button" on giphy. Wasn't sure if there was an error in my code – TardiCoder Sep 24 '20 at 19:40
  • just make sure the link is a valid image :) – Mech Sep 24 '20 at 19:49