【发布时间】:2015-09-03 11:24:24
【问题描述】:
我想制作一个个人网站,但我的页面中放不下视频。除非我把 max-height:100% 我仍然可以水平滚动。或者我禁用了绝对位置,但标题无法显示在视频顶部。我用过
overflow-x: hidden
但它没有工作。将视频作为背景并仍然能够在其顶部放置文本的最佳方法是什么?
非常感谢!!
video {
position: absolute;
z-index: -99;
/*min-width: 100%;
min-height: 100%;*/
width: 100%;
height: 100%;
background: url(../img/header-bg.jpg) no-repeat 0 0;
background-attachment: scroll;
background-position: center center;
background-repeat: none;
background-size: 100% auto;
-o-background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
}
header {
text-align: center;
color: #fff;
height: 100vh;
/*background-attachment: scroll;
background-image: url(../img/header-bg.jpg);
background-position: center center;
background-repeat: none;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;*/
}
<!-- Background Video -->
<video autoplay loop poster="data:image/gif,AAAA">
<source src="./ocean.mp4" type="video/mp4">
<source src="./ocean.ogv" type="video/ogv">
<source src="./ocean.webm" type="video/webm">
</video>
<!-- Header -->
<header>
<div class="container">
<div class="intro-text">
<div class="intro-lead-in">Welcome To Our Studio!</div>
<div class="intro-heading">IT'S NICE TO MEET YOU</div>
<a href="#services" class="page-scroll btn btn-xl">TELL ME MORE</a>
</div>
</div>
</header>
【问题讨论】:
标签: jquery html css twitter-bootstrap video