CSS Portal

HTML <track> Tag

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The <track> element is used to specify timed text tracks for media elements like <video> and <audio>. Timed text tracks are primarily used for subtitles, captions, descriptions, or other types of text that are synchronized with the media playback. The <track> element itself is empty, meaning it does not have closing content - it acts purely as a reference to an external text track file, typically in the WebVTT format (.vtt).

When a <track> element is included inside a media element, the browser can display its text content at the appropriate times during playback. This allows creators to provide accessibility features such as closed captions for the hearing impaired, translated subtitles for different languages, or additional metadata like chapter titles or descriptions for visually impaired users.

Multiple <track> elements can be added to a single media element to provide different languages or types of text tracks. Users can often select which track they want to display, depending on the browser or media player interface. The element itself does not directly render anything visible on the page; it simply provides the source and type information that the media player uses.

Properties

Permitted Parents
A media element, before any flow content
Content
None. It is an empty element.
Start/End Tags
Start tag: required, End tag: forbidden

Example

<video width="300" height="240" controls>
<source src="audio/toy.mp4" type="video/mp4">
<track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English">
<track src="subtitles_it.vtt" kind="subtitles" srclang="it" label="Italian">
Your browser does not support the video tag.
</video>

Attributes

default
Specifies that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate.
kind
How the text track is meant to be used. If omitted, the default kind is subtitles. Possible values:
  • subtitles
  • captions
  • descriptions
  • chapters
  • metadata
label
Specifies the kind of text track.
src
Required. Specifies the URL of the track file.
srclang
Specifies the language of the track text data (required if kind="subtitles").

Global Attributes

The <track> tag also supports the Global Attributes in HTML5

Event Attributes

The <track> tag also supports the Event Attributes in HTML5

Browser Support

The following information will show you the current browser support for the HTML <track> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.

This tag is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 26th December 2025

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!