css 我可以使横幅更广泛的旋转木马

zd287kbt  于 2023-05-19  发布在  其他
关注(0)|答案(1)|浏览(86)

我对HTML和CSS还很陌生。如何将“欢迎来到JWellness”制作成全尺寸横幅?当它在<div class="carousel...">标记中时。当我尝试使用css时:混合-混合-模式:屏幕;输出结果仅显示“TO”文本,未显示所有“WELCOME TO JWELLNESS”

.banner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.banner iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
}

.banner .text1 {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  font-weight: 1000;
  font-size: 10vw;
  text-align: center;
  text-transform: uppercase;
  background-color: rgba(255, 255, 255, 0.514);
  mix-blend-mode: screen;
}

.video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

#sidebarCollapse {
  position: fixed;
  z-index: 999;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wrapper {
  display: flex;
}

#content {
  flex-grow: 1;
  height: 100vh;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <title>Carousel Text</title>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" />
</head>

<body>
  <div class="wrapper d-flex align-items-stretch">
    <!-- Page Content  -->
    <div id="content" class="p-4 p-md-5 pt-5 d-block w-100">
      <div class="col-md-12 col-sm-12 col-xs-12 mt-4"></div>
      <div class="banner" style="border-radius: 15px">
        <div class="video-container">
          <video autoplay muted loop>
              <source src="https://mdbootstrap.com/img/video/Sail-Away.mp4" type="video/mp4" />
            </video>
        </div>
        <div id="carouselContent" class="carousel slide" data-ride="carousel">
          <div class="carousel-inner" role="listbox">
            <div class="carousel-item active text-center p-4">
              <h2 class="text1">Welcome <br />to<br />JwellNess</h2>
            </div>
          </div>
          <a class="carousel-control-prev" href="#carouselContent" role="button" data-slide="prev">
            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
          </a>
          <a class="carousel-control-next" href="#carouselContent" role="button" data-slide="next">
            <span class="carousel-control-next-icon" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
          </a>
        </div>
      </div>
    </div>
  </div>

  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>

</html>
pcww981p

pcww981p1#

使用此代码并检查它是否满足您的要求。在这个例子中,你可以给予位置CSS的横幅文本,所以然后不能采取横幅文本的高度。

.banner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.banner iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
}

.banner .text1 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    font-weight: 1000;
    font-size: 10vw;
    text-align: center;
    text-transform: uppercase;
    background-color: rgba(255, 255, 255, 0.514);
}

.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

#sidebarCollapse {
    position: fixed;
    z-index: 999;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wrapper {
    display: flex;
}

#content {
    flex-grow: 1;
    height: 100vh;
}

.box1 {
    background-color: rgba(255, 255, 255, 0.486);
    color: #fff;
    border-radius: 15px;
    width: 100%;
    height: 100%;
    padding: 20px;
}

blockquote {
    margin: 3.7em auto;
    padding: 2em;
    color: white;
    border: 2em solid transparent;
    box-shadow: 5px 3px 30px rgba(241, 234, 234, 0.735);
    color: white;
    font-size: 1.4em;
    font-family: 'Lora', serif;
    font-style: italic;
    line-height: 1.5;
    width: 100%;
}

.blockquote-container {
    margin-top: 20px;
}

.blockquote-container blockquote {
    font-size: 20px;
    font-style: italic;
    text-align: center;
}
<!DOCTYPE html>
<html lang="en">

<head>
    <title>Carousel Text</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" />
    <link rel="stylesheet" href="./assets/css/sidemenunmainpage.css" />
    <link rel="stylesheet" href="./assets/css/jwellNessText.css" />
    <link rel="stylesheet" href="./assets/css/JwellNessText2.css" />
    <link rel="stylesheet" href="./assets/css/thaiDCR.css" />
    <link rel="stylesheet" href="./assets/css/firstText.css" />
    <link rel="stylesheet" href="./assets/css/quote.css" />
    <style>
    </style>
</head>

<body>
    <div class="wrapper d-flex align-items-stretch">
        <!-- Page Content  -->
        <div id="content" class="p-4 p-md-5 pt-5 d-block w-100">
            <div class="col-md-12 col-sm-12 col-xs-12 mt-4"></div>
            <div class="banner" style="border-radius: 15px">
                <div class="video-container">
                    <video autoplay muted loop>
                        <source src="https://mdbootstrap.com/img/video/Sail-Away.mp4" type="video/mp4" />
                    </video>
                </div>
                <div id="carouselContent" class="carousel slide" data-ride="carousel">
                    <div class="carousel-inner" role="listbox">
                        <div class="carousel-item active text-center p-4">
                            <h2 class="text1">
                                Welcome <br />to<br />
                                JwellNess
                            </h2>
                        </div>
                        <div class="carousel-item text-center p-4">
                            <blockquote>
                                สร้างอนาคตด้วยเทคโนโลยีการออกแบบของญี่ปุ่นร่วมกับการใช้ IoT
                                นำไปสู่การพัฒนาความสำเร็จในอุตสาหกรรมหลักชั้นนำของญี่ปุ่น
                                ส่งเสริมบริษัทญี่ปุ่นด้วยโซลูชัน IoT ล่าสุด
                            </blockquote>
                        </div>
                    </div>
                    <a class="carousel-control-prev" href="#carouselContent" role="button" data-slide="prev">
                        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                        <span class="sr-only">Previous</span>
                    </a>
                    <a class="carousel-control-next" href="#carouselContent" role="button" data-slide="next">
                        <span class="carousel-control-next-icon" aria-hidden="true"></span>
                        <span class="sr-only">Next</span>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>

</html>

相关问题