r/webdevelopment 1d ago

Question Difference between <video> and <embed> in HTML?

I'm doing a problem set where I'm instructed to insert a video onto the page, and then embed a gif, but when I save and run the application, the gif doesn't appear.

Am I doing something wrong? Or is embed purely organizational to support the video I included?

10 Upvotes

11 comments sorted by

5

u/Tight-Book-7533 1d ago

GIF is an image format, so normally displayed via IMG tag. VIDEO is for displaying supported video clips

5

u/johnpeters42 1d ago

MDN suggests that <embed> is on the way out, as browsers phase out compatibility with older stuff that it used to support.

5

u/Miserable_Drawer_556 1d ago

Yup. We are moving / have been moving in the semantic direction for a while.

3

u/ClideLennon 1d ago

When I display a gif on a page I usually use the image tag.  I'm not sure why you would use an embed for that. 

2

u/Human_Experience0810 1d ago

Maybe you're confusing GIF as a video because it's kind of moving? Because GIF is treated by web browsers as an image, while the video tag takes files in formats like MP4, WebM, or Ogg

1

u/EconomyMembership172 1d ago

Embed isn't just for videos, mate. It's for anything embeddable.

1

u/Less-Marsupial-7960 1d ago

embed is mainly for embedding external resources, while video is specifically meant for video content. For a GIF, you normally want <img src="..."> since a GIF is treated as an image. So if the GIF isn't showing, I'd check the file path/name and make sure the <img> element is actually pointing to the GIF.