HTML Resources: Media Tags

In the previous sections, we reviewed the simplest and most frequently used tags: <h1></h1>...<h6></h6>, <p></p>, <a></a>, <img />

In this section, we add to this list by including iframes, audio files, and videos. Below we provide a description of each element, as well as the tags, attributes, and values that generate them. Each element also has a corresponding code sample that you can continue exploring on your own.

IFrames

IFrames embed other web pages inside yours. Use them to show YouTube videos, maps, or other external content. Sample code to make an IFrame (to embed another web page).

Other Websites

Note: This page blocks IFrames, so you’ll have to view this code in CodePen.io

Spotify

Vimeo & YouTube

Audio

Audio tags play sound files. Supports MP3, WAV, and OGG formats. Include multiple sources for browser compatibility. Sample code to embed an audio file (new in HTML5):

Video

Video tags play video files. Like audio, include multiple formats. The controls attribute adds play/pause buttons. Sample code to embed a video file (new in HTML5):

Loading quiz...

UNC Asheville Department of Computer Science