Which attribute specifies the source of a video in the <video> tag?

Enhance your HTML skills with our HTML Tags Test. Challenge your expertise through interactive flashcards and multiple-choice questions. Each question includes hints and thorough explanations. Prepare effectively for your HTML examination!

The attribute that specifies the source of a video in the <video> tag is "src". This attribute directly defines the path to the video file that the browser will retrieve and play. When you use the <video> element, the "src" attribute is essential for telling the browser where to find the video content you want to display.

By using the "src" attribute within the <video> tag, you enable users to play that video directly on the web page. For example:


<video controls src="video.mp4"></video>

In this code snippet, "video.mp4" is the source of the video file, and the browser will load and play this video when the page is accessed.

The other options do not serve this purpose. "source" is a valid tag that can be used within the <video> element to specify multiple video sources for fallback, but it is not an attribute of the <video> tag itself. "href" is used in links, typically with the <a> tag, and "file" is not an attribute recognized in HTML for video elements.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy