Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css z指数';ed父div背景未显示_Css - Fatal编程技术网

Css z指数';ed父div背景未显示

Css z指数';ed父div背景未显示,css,Css,我有一个带视频背景的引导程序jumbotron。视频背景为绝对位置和z索引:-1,jumbotron div为相对位置和z索引:1。这里想要的结果是在视频顶部有一个白色透明覆盖层。但是,即使我将其切换为纯色,背景属性也不可见。这是一支钢笔: html <div class="container"> <div id="block-1" class="block row jumbotron"> <div class="col col-md-12">

我有一个带视频背景的引导程序jumbotron。视频背景为绝对位置和z索引:-1,jumbotron div为相对位置和z索引:1。这里想要的结果是在视频顶部有一个白色透明覆盖层。但是,即使我将其切换为纯色,背景属性也不可见。这是一支钢笔:

html

<div class="container">
  <div id="block-1" class="block row jumbotron">
    <div class="col col-md-12">
      <respond-html id="html-5" description="HTML">                  
        <video class="video-background" autoplay="" loop="" poster="/static/template/themes/video-theme/video/video.jpg">
          <source src="https://host.ohiocashflow.com/sites/home-giveaway/videos/Productive-Morning.webm" type="video/webm">
          <source src="https://host.ohiocashflow.com/sites/home-giveaway/videos/Productive-Morning.mp4" type="video/mp4">
        </video>
      </respond-html>
      <div id="image-1" class="respond-image">          
        <img src="https://host.ohiocashflow.com:443/sites/home-giveaway/files/logo.png">
      </div>
      <p>Your purpose in life has to be bigger and better than yourself...&nbsp;<a href="#">DONATE</a></p>
    </div>
  </div>
</div>

z索引添加到父级时,将从父级开始创建新的堆叠顺序。如果希望子元素位于其父元素下方,请删除父元素
z-index
,并在子元素上使用负数
z-index

.container.jumbotron{
位置:相对位置;
框大小:边框框;
背景:rgba(255255,5);
边界半径:0!重要;
颜色:#fff;
最大宽度:100%;
保证金:0;
填充:150px0;
文本对齐:居中;
高度:350px;
}
.视频背景{
位置:绝对位置;
最高:50%;
左:50%;
最小宽度:100%;
最小高度:100%;
宽度:100%;
高度:自动;
z指数:-1;
-webkit转换:translateX(-50%)translateY(-50%);
转化:translateX(-50%)translateY(-50%);
}

你的人生目标必须比你自己更大更好


向父级添加
z索引时,将从父级开始创建新的堆叠顺序。如果希望子元素位于其父元素下方,请删除父元素
z-index
,并在子元素上使用负数
z-index

.container.jumbotron{
位置:相对位置;
框大小:边框框;
背景:rgba(255255,5);
边界半径:0!重要;
颜色:#fff;
最大宽度:100%;
保证金:0;
填充:150px0;
文本对齐:居中;
高度:350px;
}
.视频背景{
位置:绝对位置;
最高:50%;
左:50%;
最小宽度:100%;
最小高度:100%;
宽度:100%;
高度:自动;
z指数:-1;
-webkit转换:translateX(-50%)translateY(-50%);
转化:translateX(-50%)translateY(-50%);
}

你的人生目标必须比你自己更大更好

.container .jumbotron{
  position: relative;
  box-sizing: border-box;
  background: rgba(255,255,255,.5);
  border-radius: 0 !important;
  color: #fff;
  max-width: 100%;
  margin: 0 0 0 0;
  padding: 150px 0 0 0;
  text-align: center;
  height: 350px;
  z-index: 1;
}

.video-background { 
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: 100%;
  height: auto;
  z-index: -1;
  -webkit-transform: translateX(-50%) translateY(-50%);
  transform: translateX(-50%) translateY(-50%);
}