Bootstrap Carousel - 全宽,固定高度的图像,包含控件?

时间:2013-08-30 16:52:45

标签: html css twitter-bootstrap carousel

我正在开发一个基于Bootstrap的新网站,并使用默认的Bootstrap轮播。我已经完美地运行了,但希望将图像幻灯片修改为全宽并保持固定高度(必要时裁剪)。

同时,我希望将控件(左/右和点指示符)和标题保留在容器内,以便与主体内容对齐。我试过简单地将控制代码放入<div class="container"></div>以及行和跨度div。但是,什么都行不通。或者,我可以通过在控件全宽的同时包含图像来做相反的事情。

有一种快速简便的方法吗?这是我的轮播的代码块:

<div id="home-carousel" class="carousel slide">
<!-- Carousel items -->
<div class="carousel-inner">
    <div class="active item">
        <img src="img/carousel-1.jpg">
        <a href="#"><div class="carousel-caption">
            <p class="carousel-title">This is the caption.</p>
            <p class="hidden-phone">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin mauris ligula, ultrices accumsan imperdiet eu, convallis in nunc. Nam commodo augue a libero vestibulum sed convallis enim mattis.</p>
        </div></a>
    </div>
    <div class="item">
        <img src="img/carousel-2.jpg">
        <a href="#"><div class="carousel-caption">
            <p class="carousel-title">I'm a caption, too!</p>
            <p class="hidden-phone">Lorem ipsum dolor sit amet, c</p>
        </div></a>
    </div>
    <div class="item">
        <img src="img/carousel-3.jpg">
        <a href="#"><div class="carousel-caption">
            <p class="carousel-title">Yeah, me too.</p>
            <p class="hidden-phone">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin mauris ligula, ultrices accumsan imperdiet eu, convallis in nunc. Nam commodo augue a libero vestibulum sed convallis enim mattis.</p>
        </div></a>
    </div>
</div>
<!-- Carousel nav -->
<ol class="carousel-indicators">
    <li data-target="#home-carousel" data-slide-to="0" class="active"></li>
    <li data-target="#home-carousel" data-slide-to="1"></li>
    <li data-target="#home-carousel" data-slide-to="2"></li>
</ol>
<a class="carousel-control" href="#home-carousel" data-slide="prev"><i class="icon-chevron-left"></i></a>
<a class="carousel-control right" href="#home-carousel" data-slide="next"><i class="icon-chevron-right"></i></a>

非常感谢任何帮助!

0 个答案:

没有答案