gpt4 book ai didi

html - 即使 z-index 较高,旋转木马字幕仍保持在叠加之下

转载 作者:太空宇宙 更新时间:2023-11-04 16:16:44 26 4
gpt4 key购买 nike

我希望我的 Bootstrap 轮播在图像上方有一个点覆盖。 Carousel Caption 应位于虚线叠加层之上。我无法让它与 z-indexes 一起工作。

我做错了什么吗? (可能安静 :-))

这是我目前所拥有的 JS Fiddle。

http://jsfiddle.net/r4x99ecf/50/

HTML:

<div class="banner">
<div class="carousel slide">
<div class="carousel-inner">
<div class="item active">
<img src="http://i.imgur.com/8hAR6s4.jpg" />
<div class="carousel-caption">This is a caption of image 1.</div>
</div>
<div class="item">
<img src="http://i.imgur.com/BPSXgEp.jpg" />
<div class="carousel-caption">This is a caption of image 2.</div>
</div>
</div>
<div class="overlay"></div>
</div>

CSS:

.carousel, .carousel-inner {
height: 350px;
}

.overlay {
background: transparent url("http://i.imgur.com/8B7UFiv.png") repeat;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.carousel-caption {
position: absolute;
right: 15%;
bottom: 100px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
font-size:22px;
}

最佳答案

添加<div class="overlay"></div>.item 的每个部分

HTML

<div class="banner">
<div class="carousel slide">
<div class="carousel-inner">
<div class="item active">
<img src="http://i.imgur.com/8hAR6s4.jpg" />
<div class="carousel-caption">This is a caption of image 1.</div>
<div class="overlay"></div>
</div>
<div class="item">
<img src="http://i.imgur.com/BPSXgEp.jpg" />
<div class="carousel-caption">This is a caption of image 2.</div>
<div class="overlay"></div>
</div>
<div class="item">
<img src="http://i.imgur.com/Vk1Y6v0.jpg" />
<div class="carousel-caption">This is a caption of image 3.</div>
<div class="overlay"></div>
</div>
</div>

</div>
</div>

fiddle :http://jsfiddle.net/r4x99ecf/51/

关于html - 即使 z-index 较高,旋转木马字幕仍保持在叠加之下,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31579325/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com