【问题标题】:cover-video background does not work properly封面视频背景无法正常工作
【发布时间】:2018-04-26 01:00:26
【问题描述】:

我正在尝试将视频作为背景附加到文章部分。问题是在小屏幕上它只显示在文章的 1/3 中。为了实现这一点,我使用了文章类、作为包装器的背景 div 和视频元素 id。有什么想法吗?

<article class=”myArticle”>

 <div class="fullscreen-bag">

       <video id="videoBack">
          <source src=" " type="video/mp4">
          <source src=" " type="video/ogg">
          <source src=" " type="video/webm">
       </video>

 </div> 

 <div class="container">
      //
      //
 </div> 


</article>

//Css

.myArticle {
    position: relative;
    overflow: hidden;
}

.fullscreen-bag {
    overflow: hidden;
    position: absolute;
    height: auto;
    width: auto;
    z-index: -100;
    top: 0;
    left: 0;
    min-width: 100%;
    min-height: 100%;
}
#VideoBack {
    position: absolute;
    z-index: -100;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

【问题讨论】:

    标签: html twitter-bootstrap css responsive-design html5-video


    【解决方案1】:

    我找到了解决方案。我删除了#VideoBack 规则,并在视频标签内应用了 .fullscreen-bag。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多