css - 全屏视频下添加内容-定位

标签 css layout css-position fullscreen

我想在整页视频下方添加内容。但是在添加时,内容会填充在视频上方而不是下方。

所以,我要找的是:

enter image description here

但相反,我通过视频获取文本:jsFiddle

HTML

<div id="video-container">
<video id="bgVid" loop class="fillWidth" autoplay poster="<?php echo bloginfo( 'template_directory' ) . '/images/ship-bg.jpg'; ?>" alt="ship cargo">
<source src=video/science.mp4 type=video/mp4>
</video> 
</div>

<div id="underneath">   
<p style="color:#fff">content underneath</p>
</div>

CSS

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

}
video#bgVid {
    position:absolute;
    z-index:-1;
    background: url('../images/ship-bg.jpg') no-repeat;
    background-size: cover;
    transition: 1s opacity;
}
video#bgVid.fillWidth {
    width: 100%;
}

我尝试过,玩过,但失败了。任何人都可以请教。

JSFiddle

非常感谢。

最佳答案

试试这个

#underneath{
position:relative;
z-index:-2;
}

关于css - 全屏视频下添加内容-定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28831859/

相关文章:

ios - Angular 应用程序中仅在 iOS 上发生的 CSS 未知失真

html - 边框不延伸过去的 float 元素?

c# - ASP.Net 中是否有标准的表单布局方式?

html - 我无法使用 HTML 或 CSS 来按照我需要的方式操作该图像

css - 如何设置固定元素的宽度以适合整个页面?

html - tr 不显示边框底部

html - 如何修复有效的粘性页脚,但在调整浏览器窗口大小后,页脚重叠

html - 为什么我的 "container"div 不包含我的 float 元素?

html - 绝对容器中的 CSS flex 布局

javascript - HTML、Javascript : Display only few digits on form view, 但所有数字都在编辑