Sunday 24 March 2013

How To Use YouTube Video as Your Website Background Page

Now you can easily put any YouTube video as your background page of your website like you see on Bing search engine. You can do this by just using simple two lines of code. We will explain you how you can do it.


The technique behind it is vary simple. Bing search engine uses HTML5 to put video on their background pages. They are using simple <video> tag to add video to background page. The video which is inserted has fixed size and shape. You have another option that you can add simple jQuery plugins or other videos.js files that can all you to insert any video in your page.

How to add YouTube Video:

We don't want you to get confuse anyone because of the technique and the HTML code which require to insert video in to your page. You have to do just simple thing of copy and paste. The code which we have given below.


  <div style="position: fixed; z-index: -99; width: 100%; height: 100%">
  <iframe frameborder="0" height="100%" width="100%"
    src="https://youtube.com/embed/ID?autoplay=1&controls=0&showinfo=0&autohide=1">
  </iframe>
</div>

// Replace ID with the actual ID of your YouTube video


This code you have to insert below near the opening of <body> tag and then when you insert any video you have to change the ID which mansion in the code. you can adjust the height and width of the video using the code.

This is very simple technique and anyone can do this using this code and make their website attractive for visitors

No comments:

Post a Comment