如何在 bootstrap 滑块中保持背景图像不变?
How to constant background image in bootstrap slider?
我正在使用 bootstrap 滑块(https://blackrockdigital.github.io/startbootstrap-full-slider/)并且我必须保持背景不变 image.I 只想在背景中使用一张图片,这样只有内容会 slide.You伙计们可以检查一下 link 背景中有 3 张图片(第一张幻灯片、第二张幻灯片、第三张幻灯片)。我只能使用第一张幻灯片 image.would 你能帮我吗?
使用下面的代码
Css
.carousel-inner {
height: 100%;
background-image:url('http://placehold.it/300?text=placehold');
}
HTML
<!-- Wrapper for Slides -->
<div class="carousel-inner">
<div class="item active">
<!-- Set the first background image using inline CSS below. -->
<div class="fill" style="font-size: 32px;text-align: center;padding-top: 100px;">Slide 1</div>
<div class="carousel-caption">
<h2>Caption 1</h2>
</div>
</div>
<div class="item">
<!-- Set the second background image using inline CSS below. -->
<div class="fill" style="font-size: 32px;text-align: center;padding-top: 100px;">Slide 2</div>
<div class="carousel-caption">
<h2>Caption 2</h2>
</div>
</div>
<div class="item">
<!-- Set the third background image using inline CSS below. -->
<div class="fill" style="font-size: 32px;text-align: center;padding-top: 100px;">Slide 3</div>
<div class="carousel-caption">
<h2>Caption 3</h2>
</div>
</div>
</div>
我正在使用 bootstrap 滑块(https://blackrockdigital.github.io/startbootstrap-full-slider/)并且我必须保持背景不变 image.I 只想在背景中使用一张图片,这样只有内容会 slide.You伙计们可以检查一下 link 背景中有 3 张图片(第一张幻灯片、第二张幻灯片、第三张幻灯片)。我只能使用第一张幻灯片 image.would 你能帮我吗?
使用下面的代码
Css
.carousel-inner {
height: 100%;
background-image:url('http://placehold.it/300?text=placehold');
}
HTML
<!-- Wrapper for Slides -->
<div class="carousel-inner">
<div class="item active">
<!-- Set the first background image using inline CSS below. -->
<div class="fill" style="font-size: 32px;text-align: center;padding-top: 100px;">Slide 1</div>
<div class="carousel-caption">
<h2>Caption 1</h2>
</div>
</div>
<div class="item">
<!-- Set the second background image using inline CSS below. -->
<div class="fill" style="font-size: 32px;text-align: center;padding-top: 100px;">Slide 2</div>
<div class="carousel-caption">
<h2>Caption 2</h2>
</div>
</div>
<div class="item">
<!-- Set the third background image using inline CSS below. -->
<div class="fill" style="font-size: 32px;text-align: center;padding-top: 100px;">Slide 3</div>
<div class="carousel-caption">
<h2>Caption 3</h2>
</div>
</div>
</div>