【发布时间】:2014-08-22 05:41:59
【问题描述】:
我正试图让我的引导轮播在固定位置充当背景。在我的实际代码中,我将其设置为填满屏幕的全宽和全高,但它只停留在一个地方。我在包含轮播的部分的一个类中添加了“位置:固定”,因此它会浮动在前面,我打算将它索引到我的其余内容的后面,但它就完全消失了?
我在这个简化的例子中复制了这个问题:
HTML
<div class="fill bg-green">
<div>content section (scroll down)</div>
</div>
<div class="fill bg-white">
<div>content section (further x)</div>
</div>
<div class="fill bg-green fixed-section"> <!-- fixed section declared here -->
<-- carousel code -->
</div>
<div class="fill bg-white">
<div>content section</div>
</div>
CSS:
.fill {
width: 100%;
height: 100%;
position: relative;
}
.fixed-section {
position: fixed; /* controls fixed carousel positioning here */
}
【问题讨论】:
标签: css twitter-bootstrap background carousel fixed