Skip to main content
D
HTML
HTML Media

HTML Media

HTML media elements embed audio and video into web pages.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

Modern HTML supports rich media without external plugins. Developers embed video clips, songs, and background animations natively. Browsers support different file formats like MP4 and WebM.

Syntax

Syntax
1<!-- NOTE: reference file does not cover media syntax template fully — placeholder used -->
2<video src="clip.mp4"></video>

Example

Example
1<!-- this shows media options -->
2<!DOCTYPE html>
3<html lang="en">
4  <head>
5    <meta charset="UTF-8">
6    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7    <title>Media</title>
8  </head>
9  <body>
10    <h2>Multimedia</h2>
11    <p>We use video and audio tags for this.</p>
12  </body>
13</html>

Try it Yourself

Hands-on Practice
Modify the code below to see how it affects the output. This is the best way to learn!
Interactive Editor
1234567891011121314151617181920
Live Preview

Key Points

  • HTML5 plays media without flash plugins.
  • MP4 dominates web video formats.
  • MP3 dominates web audio formats.
  • File sizes impact page loading speeds.

Up Next

Continue your journey with the next topic.

Go to HTML Video