HTML and CSS Reference
Lesson 9. Adding Media
We browse the Internet in search of interesting and informative content, which we usually
find in the form of plain text. To accompany this plain text, HTML provides ways to embed
rich media in the form of images, audio tracks, and videos, as well as to embed content from
another web page in the form of an inline frame.
The ability to include images, audio tracks, videos, and inline frames within websites has
been around for some time. Browser support for images and inline frames has generally
been pretty good. And while the ability to add audio tracks and videos to a website has been
around for years, the process has been fairly cumbersome. Fortunately, this process has im-
proved and is much easier with support directly from HTML.
Today, we can freely use images, audio, video, and inline frames knowing that this content
is supported across all major browsers.
To add images to a page, we use the <img> inline element. The <img> element is a self-
containing, or empty, element, which means that it doesn't wrap any other content and it
exists as a single tag. For the <img> element to work, a src attribute and value must be
URL, typically relative to the server where a website is hosted.
Figure 9.1 An image embedded within HTML