HTML Media (Video & Audio) — Free HTML Tutorial
Learn HTML Media (Video & Audio) in HTML with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn HTML Media (Video & Audio) in HTML with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
HTML Media (Video & Audio) in HTML
HTML5 introduced native <video> and <audio> elements — no more Flash plugins needed! Browsers can now play media directly.
The <video> element accepts MP4, WebM, and OGG formats. Add multiple <source> elements for cross-browser compatibility. The controls attribute shows play/pause/volume UI.
The <iframe> element embeds external content like YouTube videos, Google Maps, and other websites. Use it to embed YouTube by replacing /watch?v= with /embed/.
HTML Media (Video & Audio) — Syntax
<video controls width="400"> <source src="video.mp4" type="video/mp4"> </video> <audio controls> <source src="audio.mp3" type="audio/mpeg"> </audio> <iframe src="https://www.youtube.com/embed/VIDEO_ID"></iframe>
Learn HTML Media (Video & Audio) step by step with Syllab's free interactive HTML tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full HTML course →