Lesson 47 of 55 · HTML
The `<track>` Element – Subtitles and Captions
Duration: 9 min
The <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 values
captions– 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).
VTT file format (sample)
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.
Accessibility compliance
- Provide captions (
kind='captions') for any video that conveys essential information – this satisfies WCAG AA. - Use
srclangto indicate the language of each track. - Ensure the default track is appropriate for the primary audience.
Quick checklist for <track>
kind='captions'present for essential video content? ✅- VTT files correctly formatted and linked? ✅
srclangattribute matches the language of the track? ✅- Default track (
default) set for the primary language? ✅ - Tested with screen readers to confirm captions are accessible? ✅
Tip: For long‑form video, also add a
chapterstrack so users can jump to sections easily.