【发布时间】:2021-02-16 17:34:40
【问题描述】:
我正在做一个网站 hobbinternational.com,我需要主页中的视频覆盖整个屏幕并且标题是透明的。我尝试了很多,但找不到解决方案。有人可以帮忙吗?
【问题讨论】:
标签: wordpress video fullscreen
我正在做一个网站 hobbinternational.com,我需要主页中的视频覆盖整个屏幕并且标题是透明的。我尝试了很多,但找不到解决方案。有人可以帮忙吗?
【问题讨论】:
标签: wordpress video fullscreen
将position: fixed; 添加到.page-header
对于其他人,这里是背景视频的示例
.bg-video-wrap {
position: relative;
overflow: hidden;
width: 100%;
height: 100vh;
background: url(https://designsupply-web.com/samplecontent/vender/codepen/20181014.png) no-repeat center center/cover;
}
video {
min-width: 100%;
min-height: 100vh;
z-index: 1;
}
.overlay {
width: 100%;
height: 100vh;
position: absolute;
top: 0;
left: 0;
background-image: linear-gradient(45deg, rgba(0,0,0,.3) 50%, rgba(0,0,0,.7) 50%);
background-size: 3px 3px;
z-index: 2;
}
h1 {
text-align: center;
color: #fff;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
z-index: 3;
max-width: 400px;
width: 100%;
height: 50px;
}
<div class="bg-video-wrap">
<video src="https://designsupply-web.com/samplecontent/vender/codepen/20181014.mp4" loop muted autoplay>
</video>
<div class="overlay">
</div>
<h1>Fullscreen video background
</h1>
</div>
【讨论】: