Audio and video HTML elements
Your browser does not support the audio element.
Page 10 | Listen in audio
Audio and video HTML elements are an important part of modern web development. They allow developers to easily embed audio and video files into their pages, making the user experience richer and more interactive.
The element is used to embed audio files in a web page. It supports multiple audio formats including MP3, WAV and Ogg. To include an audio file on your page, you can use the following syntax:
You can also add standard audio controls to allow users to play, pause and adjust the volume of the audio file. To do this, add the "controls" attribute to the element, as shown in the example below:
The element is used to embed video files on a web page. It supports multiple video formats including MP4, WebM and Ogg. To include a video file on your page, you can use the following syntax:
Like the element, the element also supports standard video controls. To add these controls to your video file, add the "controls" attribute to the element, as shown in the example below:
In addition, you can also add subtitles and audio descriptions to your video files using tags. Captions allow hearing-impaired users to follow along with the video content, while audio descriptions allow visually-impaired users to understand what is happening in the video. To add subtitles or audio descriptions, add the tag inside the element, as shown in the example below:
In short, audio and video HTML elements are a great way to add multimedia content to your web pages. They are easy to use and offer many features to make the user experience richer and more engaging.
Now answer the exercise about the content:
_What is the syntax for adding standard audio controls to an audio file embedded in a web page using the element?
1
2
3
You are right! Congratulations, now go to the next page
You missed! Try again.
Next page of the Free Ebook:
11 CSS styles in HTML
2 minutes
Earn your Certificate for this Course for Free! by downloading the Cursa app and reading the ebook there. Available on Google Play or App Store!