HTML video tag

The HTML tag, included in HTML 5, is used to add videos to the HTML page. The video tag currently supports MP4, WebM, and Ogg file formats.

HTML video tag

The <video> tag is used to add videos to the HTML page. Video tag currently supports  MP4, WebM, and Ogg formats.


<video width="250" height="250" autoplay>
  <source src="video.mp4" type="video/mp4">
  Video tag is not supported

Optional Attribute

autoplayautoplaySpecifies that the video will start playing as soon as it is ready.
controlcontrolSpecifies that video controls should be displayed (such as a play/pause button etc).
heightpixelSets the height of the video player
looploopSpecifies that the video will start over again, every time it is finished
mutedmutedSpecifies that the audio output of the video should be muted
posterURLSpecifies an image to be shown while the video is downloading, or until the user hits the play button
preloadedSpecifies if and how the author thinks the video should be loaded when the page loads
srcURLSpecifies the URL of the video file
widthpixelSets the width of the video player

Things to remember

  • Most browsers support the MP4 format.
  • Autoplay may not work on some browsers.

Share Tweet Send
You've successfully subscribed to Geekinsta
Great! Next, complete checkout for full access to Geekinsta
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.