HTML provides several tags to embed multimedia such as images, audio, video, and external content directly into a webpage. These elements enhance user experience by adding visual and interactive components.
Use the <img> tag to display images.
<img src="image.jpg" alt="Description of image" width="300">
Use the <audio> tag to play sound files.
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
</audio>
Use the <video> tag to show video content.
<video width="400" controls poster="thumbnail.jpg">
<source src="video.mp4" type="video/mp4">
</video>
Used inside <audio> and <video> to provide multiple file formats.
<video controls>
<source src="video.mp4" type="video/mp4">
<source src="video.webm" type="video/webm">
</video>
This ensures broader browser support.
<video controls>
<source src="movie.mp4" type="video/mp4">
<track src="subtitles.vtt" kind="subtitles" srclang="en" label="English">
</video>
<iframe src="https://example.com" width="600" height="400"></iframe>
Use cases:
<figure>
<img src="photo.jpg" alt="Nature">
<figcaption>A beautiful nature scene</figcaption>
</figure>
HTML multimedia makes websites more interactive through: