HTML Media

HTML Media

HTML media refers to the use of media elements, such as images, audio, and video, within an HTML document. These elements provide a way to add rich multimedia content to a web page.

Here are a few common HTML media elements:

  1. <img>: This element is used to embed images in an HTML document. The src attribute is used to specify the source URL of the image.
  2. <audio>: This element is used to embed audio content in an HTML document. The src attribute is used to specify the source URL of the audio file. The audio element can also include controls for playing and pausing the audio.
  3. <video>: This element is used to embed video content in an HTML document. The src attribute is used to specify the source URL of the video file. The video element can also include controls for playing, pausing, and adjusting the volume of the video.

For Regular Off – Campus Job, Updates :- Click Here

Here is an example that demonstrates the use of these media elements:

<img src=”image.jpg” alt=”An example image”>
<br>
<audio controls>
<source src=”audio.mp3″ type=”audio/mpeg”>
Your browser does not support the audio element.
</audio>
<br>
<video controls>
<source src=”video.mp4″ type=”video/mp4″>
Your browser does not support the video element.
</video>

In this example, the <img> element is used to embed an image, the <audio> element is used to embed an audio file, and the <video> element is used to embed a video. The alt attribute provides alternative text for the image, in case the image cannot be loaded. The controls attribute adds play/pause and volume controls for the audio and video elements.