Module 7: HTML Multimedia Elements

HTML Images

Images are an essential part of HTML web pages. The <img> tag is used to embed images in a webpage.

Example:


<img src="image.jpg" alt="Description of Image" width="300" height="200">
            

The src attribute defines the image's source URL, and the alt attribute provides an alternative text description if the image cannot be displayed.

HTML Audio

HTML allows embedding audio files using the <audio> element. It supports multiple formats such as MP3, WAV, and OGG.

Example:


<audio controls>
    <source src="audio.mp3" type="audio/mpeg">
    Your browser does not support the audio element.
</audio>
            

HTML Video

HTML video is embedded using the <video> tag. The video element supports various formats, such as MP4, WebM, and Ogg.

Example:


<video width="320" height="240" controls>
    <source src="video.mp4" type="video/mp4">
    Your browser does not support the video tag.
</video>
            

Try It Yourself

Quiz: Test Your Knowledge

Which HTML element is used to play a video?

Coding Challenge

Embed an image, an audio file, and a video file into the code editor above. Ensure that each multimedia element has appropriate controls for user interaction.