
在Bootstrap中使用旋转木马来实现滑动图像效果,但是当窗口宽度变大时,幻灯片盒变大,而图像区域的宽度保持原样。
当图片的宽度太大时,如何修改代码,将框的左边边距放在图片的左边边距?
编辑:演示地址:http://zgzhen.freeshell.ustc.edu.cn/posters/nctu2013
我想要的效果:自动调整旋转木马盒的大小,这样右边的控制面板就不会超出范围。
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="../images/upload/nctu/1.png" alt="...">
</div>
<!-- other pictures-->
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"></a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"></a>
</div></div>发布于 2014-05-02 03:20:32
您的问题还不够清楚,您是要对图像进行居中,还是要填充图像。请试一试,让我知道更多的帮助。将下面的代码粘贴到CSS样式表中。
.carousel-inner .item img{
width: 100%;
}https://stackoverflow.com/questions/23420198
复制相似问题