用视频替换整页图像背景的最简单方法是什么?
video {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
transform: translateX(-50%) translateY(-50%);
background: url('#.jpg') no-repeat;
background-size: cover;
transition: 1s opacity;
}
<video poster="#.jpg" id="bgvid" playsinline autoplay muted loop>
<source src="#.mp4" type="video/mp4">
</video>
我使用了HTML5 UP的光谱模板,但不知道如何以最简单和最有效的方式将横幅背景替换为视频。(https://html5up.net/spectral)
非常感谢您提前:-)
发布于 2017-10-26 03:30:58
在页眉中,您可以在CSS --> #header中删除或替换页眉背景颜色
如果你是这个意思的话。
-moz-transition: background-color 0.2s ease;
-webkit-transition: background-color 0.2s ease;
-ms-transition: background-color 0.2s ease;
transition: background-color 0.2s ease;
//background: #2e3842; //delete or change this one
height: 3em;
left: 0;
line-height: 3em;
position: fixed;
top: 0;
width: 100%;
z-index: 10000;
https://stackoverflow.com/questions/46940524
复制相似问题