文字在标题中而不是新的BS4中显示



我的一页网站有问题。我的新文本部分在我的标题视频中显示。而是在我的新部分中。我想要一个视频标题。我在做什么错?

我的html

<header>
<div class="container">
  <div class="bg-wrap">
      <video poster="poster.png" autoplay="true" loop muted>
      <source src="img/video.mp4" type="video/mp4">
      <source src="img/video.webm" type="video/webm">
    </video>
    <div class="header-text">
      <h1>Elektro Sikora</h1>
      <p>Informační portál Elektro Sikora Český Těšín</p>
    </div>
    <div id="scroll">
      <div class="round">
        <div class="wheel"></div>
      </div>
      <div class="scrolling">
        <span class="arrow"></span>
      </div>
    </div>
  </div>
  </div>
</header>
  <section id="content-space">
    <div class="container">
      <div class="row">
        <div class="col-lg-12 text-center">
          <p>
            Kompletní nabídka produktů, které nabízíme. Najdete zde od elektroniky až po zdravou výživu.
          </p>
        </div>
      </div>
    </div>
  </section>

我的CSS

/* Nav */
.navbar {
  padding: 1,2rem;
}
/* Video */
.bg-wrap {
  position: fixed;
  z-index: -1000;
  width: 100%;
  height: 100%;
  overflow: hidden;
  top: 0;
  left: 0;
}
video {
  top: 70px;
  left: 0;
  min-height: 100%;
  min-width: 100%;
}
.header-text {
  position: absolute;
  width: 100%;
  min-height: 100%;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.4);
}
.header-text h1 {
  text-align: center;
  font-size: 65px;
  text-transform: uppercase;
  font-weight: 300;
  color: #fff;
  padding-top: 15%;
  margin-bottom: 10px;
}
.header-text p {
  text-align: center;
  font-size: 20px;
  letter-spacing: 3px;
  color: #fff;
}
#scroll {
  cursor: pointer;
  display: block;
  position: absolute;
  bottom: 50px;
  left: 50%;
  z-index: 1000;
}
.round {
  height: 21px;
  width: 14px;
  border-radius: 10px;
  transform: none;
  border: 2px solid #fff;
  top: 170px;
}
.wheel {
  animation-delay: 0s;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-name: scrolling;
  animation-play-state: running;
  animation-timing-function: linear;
  background: #fff none repeat scroll 0 0;
  border-radius: 10px;
  height: 3px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  top: 4px;
  width: 2px;
}
.scrolling span {
    display: block;
    width: 5px;
    height: 5px;
    -ms-transform: rotate(45deg);
    -o-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    margin: 3px 0 3px 5px;
}
.arrow {
    margin-top: 6px;
}
header {
  height: 100vh;
  overflow: hidden;
}

nav消失和可滚动视频

由于视频为 position: absolute;,因此不超出页面的流程。您需要向标头元素添加一个高度才能工作。

header {
    height: 100vh;
    overflow: hidden;
}

我希望这种修改后的CSS对您有用。

/* Nav */
.navbar {
  padding: 1.2rem;
}
/* Video */
.bg-wrap {
  position: absolute;
  z-index: -1000;
  width: 100%;
  height: 100%;
  overflow: hidden;
  top: 0;
  left: 0;
}
video {
  position: relative;
  top: 70px;
  left: 0;
  min-width: 100%;
  background: black;
}
.header-text {
  position: absolute;
  top: 0;
  width: 100%;
  min-height: 100%;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.4);
}
.header-text h1 {
  text-align: center;
  font-size: 65px;
  text-transform: uppercase;
  font-weight: 300;
  color: #fff;
  padding-top: 15%;
  margin-bottom: 10px;
}
.header-text p {
  text-align: center;
  font-size: 20px;
  letter-spacing: 3px;
  color: #fff;
}
#scroll {
  cursor: pointer;
  display: block;
  position: absolute;
  bottom: 50px;
  left: 50%;
  z-index: 1000;
}
.round {
  height: 21px;
  width: 14px;
  border-radius: 10px;
  transform: none;
  border: 2px solid #fff;
  top: 170px;
}
.wheel {
  animation-delay: 0s;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-name: scrolling;
  animation-play-state: running;
  animation-timing-function: linear;
  background: #fff none repeat scroll 0 0;
  border-radius: 10px;
  height: 3px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  top: 4px;
  width: 2px;
}
.scrolling span {
    display: block;
    width: 5px;
    height: 5px;
    -ms-transform: rotate(45deg);
    -o-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    margin: 3px 0 3px 5px;
}
.arrow {
    margin-top: 6px;
}
header {
  height: 100vh;
  overflow: hidden;
}
.container {
  height: 100%;
  width: 100%;
}
<header>
<div class="container">
  <div class="bg-wrap">
      <video poster="poster.png" autoplay="true" loop muted>
      <source src="img/video.mp4" type="video/mp4">
      <source src="img/video.webm" type="video/webm">
    </video>
    <div class="header-text">
      <h1>Elektro Sikora</h1>
      <p>Informační portál Elektro Sikora Český Těšín</p>
    </div>
    <div id="scroll">
      <div class="round">
        <div class="wheel"></div>
      </div>
      <div class="scrolling">
        <span class="arrow"></span>
      </div>
    </div>
  </div>
  </div>
</header>
  <section id="content-space">
    <div class="container">
      <div class="row">
        <div class="col-lg-12 text-center">
          <p>
            Kompletní nabídka produktů, které nabízíme. Najdete zde od elektroniky až po zdravou výživu.
          </p>
        </div>
      </div>
    </div>
  </section>

最新更新