html tutorial - controls Attribute in HTML - html5 - html code - html form

Learn html - html tutorial - controls attribute in html - html examples - html programs
- The controls attribute defines which audio/video controls should be visible.
- This attribute is a Boolean attribute.
- Full screen toggle (for video only)
- Subtitles (for video only)
- Track
- Pause
- Seeking
- Play
- Volume
Syntax for controls attribute in HTML:
<video controls >
Differences between HTML 4.01 and HTML5 for controls attribute:
HTML 4.01
- The <video> and <audio> tag has not been defined.
HTML 5
- The <video> and <audio> tag is added.
Applies To:
Element | Attribute |
---|---|
<audio> | contols |
<video> | contols |
Sample Coding for controls Attribute in HTML:
Tryit<!DOCTYPE html>
<html>
<head>
<title>Wikitechy controls attribute</title>
</head>
<body>
<video width="300" height="300" controls>
<source src="hibiscus.mp4" type="video/mp4">
</video>
</body>
</html>
Code Explanation for controls Attribute in HTML:

- <video> tag is used to embed a video.
- controls attribute used to enable the video controls.
- <source> tag, used to specify the URL of video file.
- src attribute used to specifies the URL of the media file
- typeattribute used to specify the type of the media and its codec type.
Output for controls Attribute in HTML:

- The output shows the video with its controls.
Browser Support for controls Attribute in HTML:
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|
4.0 | 9.0 | 3.5 | 4.0 | 10.5 |