如何将视频设置为我的页面背景? [英] How to set a video as my page background ?

查看:404
本文介绍了如何将视频设置为我的页面背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置此网站的网站背景

www.hashtagmyass.com [ ^ ]

解决方案

请检查此主题



http://stackoverflow.com/questions/3800813/video-as-site-background-html-5 [ ^ ]



​​http://stackoverflow.com/questions/3899865/can-you-display-html5-视频作为全屏背景 [ ^ ]



http:// pupunzi .open-lab.com / 2010/03/22 / youtube-movie-as-background / [ ^ ]


http://demosthenes.info/blog/777/Create-Fullscreen-HTML5-Page-Background-Video [ ^ ]



https://www.youtube.com/watch?v=BoP2In1qJxc [ ^ ]



如果你有任何帮助,请点击这里。

谢谢

:)


需要添加以下代码来实现:



css *****************

 video-block  {
position 已修复;
top 50%;
left 50%;
z-index 1;
min-width 100%;
min-height 100%;
width au to;
height 自动;
转换 translate(-50%, - 50%);
}
text-wrapper {
position relative;
top 30%;
z-index 2;
margin 0px auto;
max-width 720px;
text-align center;
}



html代码************

 <   body  >  
< span class =code-keyword>< div class = text-wrapper >
< h1 > 标题< / h1 >
< p > Lorem ipsum dolor sit amet,consectetur adipisicing elit。 Suscipit qui voluptatum enim est deserunt assumenda,aspernatur quam aperiam!< / p >
< a href = class = content__cta > 链接< / a >
< / div >
< video id = demo < span class =code-attribute> class = video-block autoplay = autoplay loop = loop muted = width = 300 height = 150 >
< source src = http://thenewcode.com/assets/videos/polina.webm type = video / webm >
< source src = http://thenewcode.com/assets/videos/polina.mp4 类型 = video / mp4 >
< source src = media / demo.ogv type = video / ogg / >
< / body >



我希望这会帮助你实现 - :)


How to set a site background like this site
www.hashtagmyass.com[^]

解决方案

please check this threads

http://stackoverflow.com/questions/3800813/video-as-site-background-html-5[^]

http://stackoverflow.com/questions/3899865/can-you-display-html5-video-as-a-full-screen-background[^]

http://pupunzi.open-lab.com/2010/03/22/youtube-movie-as-background/[^]


http://demosthenes.info/blog/777/Create-Fullscreen-HTML5-Page-Background-Video[^]

https://www.youtube.com/watch?v=BoP2In1qJxc[^]

Check here if you get any help.
Thanks
:)


Need to add below code to implement :

css*****************

.video-block {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
}
.text-wrapper {
    position: relative;
    top: 30%;
    z-index: 2;
    margin: 0px auto;
    max-width: 720px;
    text-align: center;
}


html code ************

<body>
<div class="text-wrapper">
  <h1>Heading</h1>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit qui voluptatum enim est deserunt assumenda, aspernatur quam aperiam!</p>
  <a href="#" class="content__cta">Link</a>
</div>
<video id="demo" class="video-block" autoplay="autoplay" loop="loop" muted="" width="300" height="150">
<source src="http://thenewcode.com/assets/videos/polina.webm" type="video/webm">
<source src="http://thenewcode.com/assets/videos/polina.mp4" type="video/mp4">
<source src="media/demo.ogv" type="video/ogg" />
</body>


I Hope this will help you to implement -:)


这篇关于如何将视频设置为我的页面背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆