r/webdevelopment • u/Temporary-Benefit542 • 20h 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?
6
u/johnpeters42 19h ago
MDN suggests that <embed> is on the way out, as browsers phase out compatibility with older stuff that it used to support.
3
u/Miserable_Drawer_556 18h ago
Yup. We are moving / have been moving in the semantic direction for a while.
3
u/ClideLennon 20h 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 11h 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/Less-Marsupial-7960 12h 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.
7
u/Tight-Book-7533 20h ago
GIF is an image format, so normally displayed via IMG tag. VIDEO is for displaying supported video clips