【发布时间】:2015-11-05 23:11:20
【问题描述】:
我正在使用 Bootstrap 中的基本全屏轮播。效果很好,全屏。问题是我需要为其添加自定义页眉和页脚(以及中心的一些文本)。我希望页眉和页脚与轮播重叠(就像轮播在后台一样)。这可能吗?我已经尝试过使用 z-index ,但到目前为止没有成功。
这是轮播的代码。
<!-- Full Page Image Background Carousel Header -->
<header id="myCarousel" class="carousel slide">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for Slides -->
<div class="carousel-inner">
<div class="item active">
<!-- Set the first background image using inline CSS below. -->
<div class="fill" style="background-image:url('assets/img/background-image.jpg');"></div>
</div>
<div class="item">
<!-- Set the second background image using inline CSS below. -->
<div class="fill" style="background-image:url('assets/img/background-image.jpg');"></div>
</div>
<div class="item">
<!-- Set the third background image using inline CSS below. -->
<div class="fill" style="background-image:url('assets/img/background-image.jpg');"></div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="icon-next"></span>
</a>
</header>
【问题讨论】:
-
你想在这里达到什么目的?
-
@FiidoFirdauz 我希望网站背景成为轮播。我希望能够将内容放在轮播之上。 (即页眉、页脚和中间的一个段落)。
-
这个问题已经在这里回答了stackoverflow.com/questions/19469705/…
-
@NJ_93 我之前看过,但仍然无法正常工作。我究竟在哪里为页眉和页脚添加 HTML 标记?因为如果我在轮播代码之前添加页眉,在轮播代码之后添加页脚,我也会遇到同样的问题。我没有重叠,它只是让轮播不再全屏。
标签: html css twitter-bootstrap carousel