contact@codebetter.in 8823075444
9993928766
  • Tutorials Home
  • Contact

How do you embed a <video> in an HTML document?

HTML allows playing video in the web browser by using the <video> tag or <iframe> tag. To embed the video in the webpage, we use the src element for mentioning the file address, and width and height attributes are used to define its size.

Example:

<!DOCTYPE html>
<html>
<body style="text-align: center">
<p>Adding Video on my Webpage</p>
<video width="500px" height="500px" controls="controls">
<source src="vid.mp4" type="video/mp4" />
</video>
</body>
</html>
Output:

Adding Video on my Webpage