In HTML5 video, which element is used to provide text tracks such as subtitles or captions?

Prepare for the uCertify CIW Advanced HTML5 and CSS3 Specialist Exam. Dive into essential topics with flashcards and multiple-choice questions. Enhance your understanding with hints and explanations for each question. Pass your exam confidently!

Multiple Choice

In HTML5 video, which element is used to provide text tracks such as subtitles or captions?

Explanation:
Text tracks for HTML5 video are added with the track element inside the video tag. The track element carries a kind attribute to indicate the type of text track—subtitles or captions are just values of that kind, not separate elements. In practice you link to a WebVTT file using the src attribute, and you can also set language with srclang, a display name with label, and default to show it automatically. The source element is for the video or audio file itself, not for text tracks. For example: <video controls> <source src="movie.mp4" type="video/mp4"> <track kind="subtitles" srclang="en" label="English" src="subs-en.vtt" default> </video>. This is why the element used to provide text tracks is the track element.

Text tracks for HTML5 video are added with the track element inside the video tag. The track element carries a kind attribute to indicate the type of text track—subtitles or captions are just values of that kind, not separate elements. In practice you link to a WebVTT file using the src attribute, and you can also set language with srclang, a display name with label, and default to show it automatically. The source element is for the video or audio file itself, not for text tracks. For example: . This is why the element used to provide text tracks is the track element.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy