使用视频作为背景 [英] Using a video as a background

查看:134
本文介绍了使用视频作为背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道使用视频作为背景的一种好方法,例如Square Cash中使用的方法: https://square.com/cash

I want to know which is a good way to use a video as a background, like is used for example in Square Cash: https://square.com/cash

推荐答案

<div id="video-container">
<video autoplay loop poster="http://media.w3.org/2010/05/sintel/poster.png" muted="muted">
                    <source id="mp4" src="http://media.w3.org/2010/05/sintel/trailer.mp4" type="video/mp4">
                    <source id="webm" src="http://media.w3.org/2010/05/sintel/trailer.webm" type="video/webm">
                    <source id="ogv" src="http://media.w3.org/2010/05/sintel/trailer.ogv" type="video/ogg">
                    Your browser does not support the video tag. I suggest you upgrade your browser.
                </video>
</div><!-- end video-container -->




#video-container {
    top:0%;
    left:0%;
    height:100%;
    width:100%;
    overflow: hidden;
        position: absolute;
}
video {
    position:absolute;
    z-index:0;
        width: 100%;
}

这篇关于使用视频作为背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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