Media & Embedded Content

HTML <video> Tag

The <video> tag is used to embed video content in a document, such as a movie clip or other video streams.

Definition and Usage

The <video> tag is used to embed video content in a document, such as a movie clip or other video streams.

Standard Syntax:<video>...</video>

Interactive ExampleRunnable

HTML <video> Example

html
Try it Yourself
Live code demonstration for the <video> tag. Click "Try it Yourself" to edit and experiment in real time.
<div style="font-family: system-ui, sans-serif; padding: 16px; background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; color: #0f172a;">
<video width="320" height="240" controls>

  <source src="movie.mp4" type="video/mp4">

  <source src="movie.ogg" type="video/ogg">

  Your browser does not support the video tag.

 </video>
</div>

Attributes for <video>

9 Supported Attributes
AttributeValuesDefaultDescription
autoplayautoplaynoneSpecifies that the video will start playing as soon as it is ready
controlscontrolsnoneSpecifies that video controls should be displayed (such as a play/pause button etc).
heightpixelsnoneSets the height of the video player
looploopnoneSpecifies that the video will start over again, every time it is finished
mutedmutednoneSpecifies that the audio output of the video should be muted
posterURLnoneSpecifies an image to be shown while the video is downloading, or until the user hits the play button
preloadauto metadata nonenoneSpecifies if and how the author thinks the video should be loaded when the page loads
srcURLnoneSpecifies the URL of the video file
widthpixelsnoneSets the width of the video player
Global Attributes

The <video> tag also supports the standard global attributes in HTML, including class, id, style, title, hidden, and data-*.

HTML Global Attributes Reference →
Event Attributes

The <video> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.

HTML Event Attributes Reference →

Browser Compatibility

ChromeEdgeFirefoxSafariOpera

More Tags in Media & Embedded Content

View All 123Tags →