All of us who own a website, usually keep a beautiful picture as the background for a page. Some other interesting options could be placing some moving images at the back or a short animation/video clip, which could provide a richer experience. Bing homepage often uses video clips as it’s background. You can do the same on your website as well. Some of the ways re given below: Bing uses the standard HTML5 tags to place videos on background. This video always has a fixed size and doesn’t resize itself with the size of the browser.
1. <div style=”position: fixed; z-index: -99; width: 100%; height: 100%”>
2. <iframe frameborder=”0″ height=”100%” width=”100%”
7. // Write ID of your YouTube video on the place of ID
The Geocities era had websites which would automatically start playing their music as soon as the website was opened. In such cases the raw audio files of MP3 ,WAV, MIDI format are used. You can use any of your favourite You Tube videos as embedded background audio.
You need to embed a regular YouTube video (with autoplay=1) and then set the height and width of the video player to zero which will render it invisible. This can be done using a single line of code which can be added anywhere on the web page. The code is given below:-
1. <embed height=”0″ width=”0″
2. src=”http://youtube.googleapis.com/v/VIDEO_ID&autoplay=1&loop=1″ />