【发布时间】:2016-10-16 23:31:59
【问题描述】:
我创建了一个 Bootstrap 轮播,我正在使用自定义 css 为三张幻灯片中的每一张定义一个背景图像。出于某种原因,虽然幻灯片 2 和 3 的背景图像显示正常,但背景图像没有出现在第一张幻灯片上。我不知道出了什么问题。我认为这可能与仅应用于第一张幻灯片的活动类有关?这是第一张幻灯片的 HTML 和 CSS,轮播名为 myCarousel,谢谢:
HTML:
<!-- class item means item in carousel -->
<div id="slide1" class="item active">
<!--
<img src="http://placehold.it/1200x500">
-->
<h1>HELLO THERE</h1>
<div class="carousel-caption">
<h4>High Quality Domain Names</h4>
<p>Domains that can help your business marketing</p>
</div> <!-- close carousel-caption -->
</div> <!-- close slide1 -->
CSS:
#myCarousel .item { height: 400px; }
<!-- top left is the background position of the image, no repeat because we don't want the background image repeating -->
#slide1 {
background: url('images/carousel_medium_01.jpg') top center no- repeat;
}
【问题讨论】:
标签: css twitter-bootstrap