Providing YouTube on a web page

The <iframe> element keeps a YouTube video on the same page by embedding the video inside its frame.

Here is YouTube information about how to embed a video, it's pretty easy. Check the code on this page to see what iframe code looks like, including some of the available attributes. Here is more information about iframes:

This iframe uses the pixel dimensions provided by YouTube, 560 x 315. The code is copied directly from the YouTube site:

The following iframe uses the same code as the above image. However, new dimensions (using the same proportions) have been changed manually. The new dimensions were calculated by dividing the original dimensions above by 2.5 - resulting in 224 x 126. Note that the image scales properly - it does not get cropped: