Video as background on Div Element [Help]
2014-01-29, 06:45 PM, (This post was last modified: 2014-01-29, 06:49 PM by fieldy2012.)
#1
Hi guys,

Im just wondering how to make a video for exmple a youtube video to become a background on ur div element..
heres my code -

div.myvid {
width:573px;
height:339px;
cursor:pointer;
}

Can anyone help em where to put or how to put a video on it so that it will become a background?thankx
Reply
2014-01-30, 10:59 PM,
#2
google is your best friend, simply search for sample codes
Reply
2014-01-31, 12:21 AM,
#3
innozemec : really helpful post bro...

Here you go OP

<body style="background: black;">
<div id="box3">
<div id="content4">
<div style="margin: auto auto; padding-top:50px;">
<iframe width="1280" height="720" src="https://www.youtube.com/embed/YTCODE?&amp;autoplay=1&amp;rel=0&amp;loop=1&amp;showinfo=0&amp;disablekb=1&amp;controls=0&amp;hd=1&amp;autohide=1&amp;color=white&amp;playlist=YTCODE" frameborder="0" allowfullscreen></iframe>
</div>
<div id="collected"><b>
</div>
</div>
</div>
</body>
Reply
2014-01-31, 12:23 AM,
#4
In fact, try to make your iframe width and height 100% of the parent div, and then just resize the div. it's a better approach and you can have whatever size you want.
Reply
2014-01-31, 12:25 AM,
#5
(2014-01-31, 12:21 AM)crystyblood Wrote: innozemec : really helpful post bro...

Here you go OP

<body style="background: black;">
<div id="box3">
<div id="content4">
<div style="margin: auto auto; padding-top:50px;">
<iframe width="1280" height="720" src="/embed/YTCODE?&amp;autoplay=1&amp;rel=0&amp;loop=1&amp;showinfo=0&amp;disablekb=1&amp;controls=0&amp;hd=1&amp;autohide=1&amp;color=white&amp;playlist=YTCODE" frameborder="0" allowfullscreen></iframe>
</div>
<div id="collected"><b>
</div>
</div>
</div>
</body>

as long as i see with that code you just placed the video inside the div, not as its background and you can't put anything above it
Reply
2014-01-31, 12:35 AM,
#6
What exactly is your question OP? If you just want to include your youtube video on your website, use the embed option from youtube.
Read more about that.

If you want to give your div a background with css, you can only do that with images (png or jpeg for example).
As far as I know you can not use videos for this.

You can embed an image through CSS by giving the url.
.selector {
background-image: (url://mywebsite.com/myimage.png);
}


Quote:innozemec : really helpful post bro...

Here you go OP

<body style="background: black;">
<div id="box3">
<div id="content4">

<div style="margin: auto auto; padding-top:50px;">
<iframe width="1280" height="720" src="/embed/YTCODE?&amp;autoplay=1&amp;rel=0&amp;loop=1&amp;showinfo=0&amp;disablekb=1&amp;controls=0&amp;hd=1&amp;autohide=1&amp;color=white&amp;playlist=YTCODE" frameborder="0" allowfullscreen></iframe>
</div>
<div id="collected"><b>
</div>
</div>
</div>

</body>

Everything I colored red is bullshit code; just a waste of space in your html file ;)


[Image: wI9cuAG.png]
Reply
2014-01-31, 12:36 AM,
#7
Try to use this plugin on your div: http://www.jqueryscript.net/other/Awesom...layer.html
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [NEW][<$30]Youtube Video Hack Proof at CHEAPEST rates.[PART2] justdidit 131 10,180 9 hours ago
Last Post: justdidit
  How to make video proof? kazurengan 15 401 2017-12-15, 12:09 AM
Last Post: cohzynes
  Content Locking Video walterzingo 8 372 2017-12-01, 03:47 PM
Last Post: CharlieHarper
  mass video blaster?? sidhesha 2 145 2017-11-30, 01:55 PM
Last Post: sidhesha
  Track YouTube Video Rank Manually+Useful Site Watt 44 2,672 2017-11-28, 08:04 PM
Last Post: Watt





About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top