Lesson 47 of 55
HTMLThe `<track>` Element – Subtitles and Captions
9 min
Course progress85%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 47 of 55
HTML9 min
Keep these ideas in mind as you work through the lesson.
<track> Element – Subtitles, Captions, and Chapters<track> adds timed‑text tracks to <video> and <audio> elements.
<video controls width='640'>
<source src='movie.mp4' type='video/mp4' />
<track kind='captions' src='captions.vtt' srclang='en' label='English' default />
<track kind='subtitles' src='captions.es.vtt' srclang='es' label='Español' />
Your browser does not support the video tag.
</video>
kind attribute valuescaptions – For the hearing‑impaired; displays by default.subtitles – Translations of spoken dialogue for multilingual audiences.descriptions – Audio descriptions for visually impaired users.chapters – Table of contents with timestamps.metadata – Timed metadata (e.g., song title, author).WEBVTT
00:00:00.000 --> 00:00:05.000
Welcome to the tutorial.
00:00:05.000 --> 00:00:10.000
Here we learn about HTML.
kind='captions') for any video that conveys essential information – this satisfies WCAG AA.srclang to indicate the language of each track.<track>kind='captions' present for essential video content? ✅srclang attribute matches the language of the track? ✅default) set for the primary language? ✅Tip: For long‑form video, also add a
chapterstrack so users can jump to sections easily.