HTML 5 Video Tag Tutorial

HTML 5 Video Tag

The HTML5 <video> tag is used to insert a video inside the HTML document.

Let us explain the term used inside the video tag

  • src attribute- It is used for providing video file location.
  • height - The height attribute of the video tag is used to set the height of the video.
  • control attribute- It is used to make video controls such as play/pause, mute, etc.

General Syntax

Try it now

Source Code

Try it now

Source Code : Output

Placing Multiple Video Inside Video Tag

You can also insert one or multiple video formats inside the video tag. The browser will choose the first one which it will be able to play.

General Syntax

Try it now

Source Code

Try it now

Source Code : Output

Other Video Attribute:

Let us see some other video attributes:

  • loop attribute - This attribute is used to play the video when it ends.
  • autoplay attribute - It is used to play video automatically when a web page is loaded.

General Syntax

Try it now

Source Code

Try it now

Source Code : Output