视频上的CSS重叠视频

时间:2018-07-03 21:26:04

标签: html css css3 video overlay

我正在尝试制作一个视频,视频上面有一个叠加层。它工作得很好,除了在手机上我的覆盖物使视频空间溢出。我希望覆盖图不会使视频溢出。这是CSS

.overlay {
  position: absolute;
  display: flex;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  width: 100%;
}

.overlay .videoButtonWrapper {
  flex-direction: row;
}

.videoBackgroundWrapper {
  position: relative;
  width: 100%;
}

.videoBackground {
  width: 100%;
}
<div class="videoBackgroundWrapper">
  <video preload="auto" autoplay="true" loop="true" class="videoBackground">
                     <source src="StockTemplates/4thofJuly/4thofJuly_HD.mp4" type="video/mp4">
                  </video>
</div>
<div class="overlay">
  <h2>Welcome to the CreativeEngine</h2>
  <p>bla bla bla bla bla</p>
  <div class="videoButtonWrapper">
    <button class="btn btn-primary">See Templates</button>
    <button class="btn btn-primary">Make Video</button>
  </div>
</div>

0 个答案:

没有答案