TardiCoder
TardiCoder

Reputation: 17

Display GIF in html 5

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!

Upvotes: 1

Views: 2361

Answers (1)

Mech
Mech

Reputation: 4015

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">

Upvotes: 1

Related Questions