我对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>
1条答案
按热度按时间pcww981p1#
使用此代码并检查它是否满足您的要求。在这个例子中,你可以给予位置CSS的横幅文本,所以然后不能采取横幅文本的高度。