嗨我有旋转木马,但旋转木马有底部空白区域this photo 我怎么解决这个问题?我的代码在这里。
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<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>
<li data-target="#carousel-example-generic" data-slide-to="4"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active"><img src="public/slider/1.jpg"><div class="carousel-caption">bas</div></div>
<div class="item"><img src="public/slider/2.jpg"><div class="carousel-caption">bas</div></div>
<div class="item"><img src="public/slider/3.jpg"><div class="carousel-caption">bas</div></div>
<div class="item"><img src="public/slider/4.jpg"><div class="carousel-caption">bas</div></div>
<div class="item"><img src="public/slider/5.jpg"><div class="carousel-caption">bas</div></div>
</div>
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span><span class="sr-only">Previous</span></a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span><span class="sr-only">Next</span></a>
</div>
答案 0 :(得分:0)
<div class="carousel-inner" role="listbox">
<div class="item active"><img src="public/slider/1.jpg" height="200" width="400"><div class="carousel-caption">bas</div></div>
<div class="item"><img src="public/slider/2.jpg" height="200" width="400"><div class="carousel-caption">bas</div></div>
<div class="item"><img src="public/slider/3.jpg" height="200" width="400"><div class="carousel-caption">bas</div></div>
<div class="item"><img src="public/slider/4.jpg" height="200" width="400"><div class="carousel-caption">bas</div></div>
<div class="item"><img src="public/slider/5.jpg" height="200" width="400"><div class="carousel-caption">bas</div></div>
</div>
或者您可以在上传之前手动编辑图像的宽度和高度。我建议手动操作,因为通过HTML设置宽度和高度有时可能会扭曲图像。