Skip to main content
D
HTML
HTML Video

HTML Video

HTML video tags embed playable movies onto the page.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

HTML uses the `

Syntax

Syntax
1<!-- video syntax -->
2<video controls>
3  <source src="vid.mp4" type="video/mp4">
4</video>

Example

Example
1<!-- this embeds a video -->
2<!DOCTYPE html>
3<html lang="en">
4  <head>
5    <meta charset="UTF-8">
6    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7    <title>Video</title>
8  </head>
9  <body>
10    <video width="320" height="240" controls>
11      <source src="movie.mp4" type="video/mp4">
12    </video>
13  </body>
14</html>

Try it Yourself

Hands-on Practice
Modify the code below to see how it affects the output. This is the best way to learn!
Interactive Editor
1234567891011121314151617181920
Live Preview

Key Points

  • The `
  • The `controls` attribute enables user interaction.
  • The `autoplay` attribute starts playback immediately.
  • Multiple `` tags ensure browser compatibility.

Up Next

Continue your journey with the next topic.

Go to HTML Audio