HTML - attributes - controls

revision:


Content

"controls" attribute: boolean attribute for the audio/video controls. syntax some examples


"controls" attribute: boolean attribute for the audio/video controls.

top

When present, it specifies that audio/video controls should be displayed.
The controls attribute can be used on the <audio> and <video> elements.

Controls should include: play, pause, seeking, volume, fullscreen toggle (for video only), captions/subtitles (for video only, when available), and track (for video only, when available)


syntax

top

<element controls>


some examples

top

Click on the play button to play a sound:

codes:
                    <audio style="margin-left:3vw;" controls>
                        <source src="../../pics/horse.wav" type="audio/wav">
                        <source src="../../pics/horse.mp3" type="audio/mpeg">
                        Your browser does not support the audio element.
                    </audio>
                
codes:
                    <video style="margin-left:3vw;" width="320" height="240" controls>
                        <source src="../../pics/Wuzhen-20-10_02.mp4" type="video/mp4">
                        Your browser does not support the video tag.
                    </video>