SimpleTuts.com

HTML Iframes & Multimedia

Embed External Content and Add Multimedia Using HTML

In this class, students will learn how to embed external content using iframes and add audio and video files to create rich multimedia webpages.

Class Objective

Introduction to Iframes

An iframe is used to embed another webpage or external content inside the current webpage.

Iframe Tag

Basic Iframe Syntax


<iframe src="https://www.example.com" width="600" height="400"></iframe>

Common Uses of Iframes

Embedding YouTube Video (Iframe)


<iframe
    width="560"
    height="315"
    src="https://www.youtube.com/embed/dQw4w9WgXcQ"
    title="YouTube video">
</iframe>
Run Code

Introduction to Multimedia in HTML

Multimedia content includes audio and video. HTML provides special tags to play media files directly in the browser.

Audio Tag


<audio controls>
    <source src="audio.mp3" type="audio/mpeg">
</audio>

Common Audio Attributes

Video Tag


<video width="400" controls>
    <source src="video.mp4" type="video/mp4">
</video>

Common Video Attributes

Practice Task

Assignment