kind
kind attribute
The kind
attribute in HTML is used within the <track>
element to define the type of text track being offered. It specifies whether the track is for subtitles, captions, descriptions, or other types of text, enabling media players to display the correct track for users.
Syntax
<track src="URL" kind="subtitles | captions | descriptions | chapters | metadata">
Example
<video controls>
<source src="video.mp4" type="video/mp4">
<track kind="subtitles" src="movie_en.vtt" srclang="en" label="English subtitles">
<track kind="captions" src="movie_es.vtt" srclang="es" label="Spanish captions">
</video>
Values
- subtitles: Provide text for dialogue and key audio cues, typically aimed at viewers who can hear but may need translations.
- captions: Display dialogue and sound descriptions for viewers who are deaf or hard of hearing.
- descriptions: Offer textual descriptions of visual content for users who are visually impaired.
- chapters: Divide the media into sections to make it easier to navigate.
- metadata: Includes information about the media, such as its creation details and authorship.
Applies To
The kind
attribute can be applied to the following HTML elements:
Conclusion
The kind
attribute in HTML specifies the type of text track linked to media elements like <video>
and <audio>
. It ensures that users receive the correct information, such as subtitles, captions, or descriptions. By defining the track type, it guarantees the appropriate content is shown to the audience. Ultimately, this attribute improves accessibility and enhances the user experience in multimedia content.
height
The height attribute in HTML specifies the height of an element, using units like pixels or percentages. It plays a key role in preserving layout consistency, while also considering aspect ratios.
loading
The HTML loading attribute controls the timing of image or iframe loading, improving performance by deferring content that’s off-screen or loading it immediately when needed.