HTML Media Tags

Introduction

HTML provides built-in tags for displaying images, audio, and video directly in the browser. These media elements are essential for building modern, interactive websites.

1. The <img> Tag

Used to embed images.

Example Image
    

2. The <audio> Tag

Embeds audio files like MP3.


    

Attributes:

3. The <video> Tag

Embeds video files directly in the browser.


    

Video Attributes:

4. Multiple Sources

Browsers support different formats. You can provide multiple sources to maximize compatibility.


    

5. Embedding YouTube Videos

Use an iframe for YouTube or Vimeo.


    

6. The <picture> Element

Responsive images with different resolutions or formats.


  
  
  Example

    

7. The <figure> and <figcaption> Tags

Add captions to media.

Subaru
My dream Subaru Impreza.

Summary