1.

HTML Elements: Adding Image and Multimedia

Answer»

  • <img>...</img>: The HTML <img> element is used to include an image in a document. An example that shows the usage of the <img> element is given below:
<img class="fit-picture"
src="/pictures/apple-660-480.jpeg"
alt="This is a picture of an apple">

  • <audio>...</audio>: Sound content is embedded in documents using the HTML <audio> element. It can have one or more audio sources, which are denoted by the src property or the source> element, with the browser picking the best one. It can also serve as a destination for media that is being streamed using a MediaStream. An example that shows the usage of the <audio> element is given below:
<figure>
<figcaption>Roaring of a lion:</figcaption>
<audio controls src="/audio/demo/lion-roaring.mp3">
Your browser is not supporting the <code>Audio</code> element.
</audio>
</figure>


  • <video>...</video>: The HTML Video element (<video>) inserts a media player into the document that allows video playback. Although you can use the <video> element for audio material, the <audio> element may give a better user experience.


  • <track>...</track>: The HTML <track> element is a child of the <audio> and <video> media components. It allows you to set timed text tracks (or time-based data), for example, to handle subtitles automatically. WebVTT (Web Video Text Tracks or Timed Text Markup Language) is used to format the tracks (.vtt files) (TTML). An example which shows the usage of the <video> and <track> elements is given below:

<video controls width="360" src="/videos/demos/teachHTML.mp4">
<track default kind="captions" srclang="en" WebsiteSetup.org - Beginner's HTML Cheat Sheet 11 src="/videos/demos/teachHTML.vtt"/>
Seems like your browser is not supporting the feature of embedded videos.
</video>


Discussion

No Comment Found