小编Arn*_*das的帖子

Bootstrap 4 轮播标题垂直对齐

我想将我的轮播标题放在引导程序 4 上,但我找不到方法。没有什么对我有用。我尝试align-items-center justify-content-center text-center在我的carousel-itemor上添加添加,carousel-caption但没有任何效果。

body {
  overflow-x: hidden;
  height: 100%
}

.carousel-item:after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
}

.carousel-item {
  height: 100vh;
}

.carousel-image-1 {
  background: url('../images/miami1.jpeg');
  background-size: cover;
}

.carousel-image-2 {
  background: url('../images/miami2.jpeg');
  background-size: cover;
}

.carousel-image-3 {
  background: url('../images/miami3.jpeg');
  background-size: cover;
}
Run Code Online (Sandbox Code Playgroud)
    <div id="myCarousel" class="carousel slide" data-ride="carousel">
        <ol class="carousel-indicators">
            <li data-target="#myCarousel" data-slide-to="0"></li>
            <li data-target="#myCarousel" data-slide-to="1" class="active"></li> …
Run Code Online (Sandbox Code Playgroud)

html css bootstrap-4

3
推荐指数
1
解决办法
6346
查看次数

标签 统计

bootstrap-4 ×1

css ×1

html ×1