Embed YouTube Videos

Hostnbit

You can add YouTube videos to your web site by using either the

iframe 

 or

object

HTML tags.

Based on the information from http://www.youtube.com/youtubeonyoursite:

  1. Use the youtube site to find the video you want
  2. Click the ‘Share’ button below the video
  3. Click the ‘Embed’ button next to the link they show you
  4. Copy the
    iframe 

     code given and paste it into the html of your web page.

Although YouTube gives you html code using the 

iframe

  tag, you can also include your video using the

object 

 tag, as seen in the example below.

 Example:

A friend’s ski video from Japan (or perhaps just use your favourite funny cat video)

<html>
 <body>
  <iframe src="https://www.youtube.com/embed/W7qWa52k-nE"
   width="560" height="315" frameborder="0" allowfullscreen></iframe>
 </body>
</html>

Example:

Use the 

object

  tag to show the same video

<html>
 <body>
  <object data="http://www.youtube.com/embed/W7qWa52k-nE"
   width="560" height="315"></object>
 </body>
</html>

 

Hostnbit

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Menu Title
Scroll to Top