• Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Script
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube
  • Tools
w3tweaks.com
  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Script
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube
  • Tools
w3tweaks.com
Home HTML

HTML media tags

Bringing Sound to Life with HTML Media Tags

February 9, 2023
in HTML

Table of Contents

  • 1. <audio>
  • 2. <video>
  • 3. <source>
  • 4. <track>
  • 5. <embed>
  • 6. <iframe>
  • 7. <svg>
  • 8. <canvas>
  • 9. <img>
  • 10. <area>
  • 11. <map>
  • 12. <figure>
  • 13. <figcaption>
  • 14. Supported browser

HTML media tags are essential elements in web development that allow you to add and control various types of multimedia content such as audio, video, images, and more on your website. They help to create engaging and interactive experiences for users by incorporating rich media elements.

HTML has several media-related tags that allow you to embed and display various types of media on a web page, including:

You might also like

Why Multi Page Form HTML is Better than Single Page Forms

The Benefits of Using Multi Step Forms in HTML

HTML Group headings

6 HTML Headings Every Blogger Should Know

HTML Semantic Elements

HTML Favicon

01
of 14
<audio>

The <audio> tag is used to embed audio files into a web page.

Example:

<audio controls>
  <source src="/wp-content/uploads/2023/02/mixkit-classic-alarm-995.wav" type="audio/wav">
  Your browser does not support the audio tag.
</audio>
Try it Yourself

Demo:

Your browser does not support the audio tag.

02
of 14
<video>

The <video> tag is used to embed video files into a web page.

Example:

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

Demo:

Your browser does not support the video tag.

03
of 14
<source>

The <source> tag is used in conjunction with the <audio> and <video> tags to specify the media source for the audio or video content.

Example:

<video controls>
  <source src="yourvideofile.mp4" type="video/mp4">
  <source src="yourvideofile.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

Demo:

Your browser does not support the video tag.

04
of 14
<track>

The <track> tag is used to add a text track to an <audio> or <video> element. It is typically used to provide captions or subtitles.

Example:

<video controls>
  <source src="yourvideofile.mp4" type="video/mp4">
  <track src="yourvideotrack.vtt" kind="subtitles" srclang="en" label="English">
</video>

05
of 14
<embed>

The <embed> tag is used to embed external content, such as a video from YouTube, on a web page.

Example:

<embed src="https://www.youtube.com/embed/bi5bfH_gVWE" width="560" height="315">
Try it Yourself

Demo:

06
of 14
<iframe>

The <iframe> tag is used to embed external content, such as a video from YouTube, within an HTML document.

Example:

<iframe width="560" height="315" src="https://www.youtube.com/embed/bi5bfH_gVWE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Try it Yourself

Demo:

07
of 14
<svg>

The <svg> tag is used to create and display scalable vector graphics.

Example:

<svg width="100" height="100">
  <circle cx="50" cy="50" r="40" fill="blue"/>
</svg>

Demo:

08
of 14
<canvas>

The <canvas> tag is used to create a drawable area for graphics on a web page.

Example:

<canvas id="myCanvas" width="200" height="100"></canvas>
<script>
  var canvas = document.getElementById("myCanvas");
  var ctx = canvas.getContext("2d");
  ctx.fillRect(20, 20, 150, 50);
  ctx.fillStyle = "red";
  ctx.fillRect(40, 40, 100, 25);
</script>

Demo:

09
of 14
<img>

The <img> tag is used to embed images into a web page.

Example:

<img src="yourimage.jpg" alt="Your Image">

10
of 14
<area>

The <area> tag is used in conjunction with the <map> tag to define the clickable areas within an image map.

Example:

<img src="yourimage.jpg" usemap="#yourmap">
<map name="yourmap">
  <area shape="rect" coords="0,0,100,100" href="#">
  <area shape="circle" coords="150,150,50" href="#">
</map>

11
of 14
<map>

The <map> tag is used in conjunction with the <img> tag to create an image map.

Example:

<img src="yourimage.jpg" usemap="#yourmap">
<map name="yourmap">
  <area shape="rect" coords="0,0,100,100" href="#">
  <area shape="circle" coords="150,150,50" href="#">
</map>

12
of 14
<figure>

The <figure> tag is used to define self-contained content, such as an illustration or a code snippet, along with its caption.

Example:

<figure>
  <img src="yourimage.jpg" alt="Your Image">
  <figcaption>Your Image Caption</figcaption>
</figure>

13
of 14
<figcaption>

The <figcaption> tag is used to define a caption for a <figure> element.

Example:

<figure>
  <img src="yourimage.jpg" alt="Your Image">
  <figcaption>Your Image Caption</figcaption>
</figure>

14
of 14
Supported browser

Here is a table showing the browser support for each of the HTML media tags:

HTML Media TagChromeFirefoxSafariEdgeInternet ExplorerOpera
<audio>YesYesYesYes11+Yes
<video>YesYesYesYes9+Yes
<source>YesYesYesYes9+Yes
<track>YesYesYesYes9+Yes
<embed>YesYesYesYesNot supportedYes
<iframe>YesYesYesYes9+Yes
<svg>YesYesYesYes9+Yes
<canvas>YesYesYesYes9+Yes
<img>YesYesYesYesAll versionsYes
<area>YesYesYesYesAll versionsYes
<map>YesYesYesYesAll versionsYes
<figure>YesYesYesYes11+Yes
<figcaption>YesYesYesYes11+Yes
Tags: htmlmediatags
Previous Post

Exploring JavaScript apply(), call(), and bind() Methods: A Comprehensive Guide with Examples

Next Post

Send Email with PHPmailer

Related Stories

Why Multi Page Form HTML is Better than Single Page Forms
HTML

Why Multi Page Form HTML is Better than Single Page Forms

February 28, 2023
The Benefits of Using Multi Step Forms in HTML
HTML

The Benefits of Using Multi Step Forms in HTML

February 15, 2023
HTML Group headings
HTML

HTML Group headings

November 22, 2022
HTML Headings h1 to h6
HTML

6 HTML Headings Every Blogger Should Know

November 22, 2022
HTML Semantic Elements
HTML

HTML Semantic Elements

October 27, 2022
HTML Favicon
HTML

HTML Favicon

October 26, 2022
Next Post
Send Email with PHPmailer

Send Email with PHPmailer

Discussion about this post

You might also like

CSS Cards

100 Creative CSS Cards

November 13, 2022
Multi step html form

44 Free Multi step HTML forms

March 7, 2023
CSS & HTML Dashboard Templates

13 Free HTML & CSS Dashboard Template Designs

December 29, 2021
49 CSS Tables

49 CSS Tables

November 13, 2019
HTML & CSS pricing tables

20 HTML & CSS pricing tables

May 2, 2020
CSS Dark Mode

14 Best CSS Dark Mode

October 13, 2021
w3tweaks

Unleash your front-end development potential by exploring the ultimate collection of UI designs and patterns, and play with them to create stunning websites through our tutorials.

Tags

Angularjs AngularJS Tutorials animation animation examples Button button hover effect Buttons Calendar calendars cards click buttons CSS css3 css buttons css calendar css calendars css effects css hover effects demo effect effects essentials forms free Free Tool hover hover animation Hover effects html inputs Javascript jquery js learn loaders menu mouse hover effects navigation php script text effects tool tutorial tutorials YouTube

Stay Connected

  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Script
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube
  • Tools

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
x
x