如何在不同类型的屏幕上调整滑块图像?我正在使用Bootstrap。
我应该添加一些CSS还是别的什么?
这是我的代码。
HTML
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="images/Cimg5.jpg" alt="Los Angeles" style="width:100%;">
</div>
<div class="item">
<img src="images/Cimg2.jpg" alt="Chicago" style="width:100%;">
</div>
<div class="item">
<img src="images/Cimg3.jpg" alt="New york" style="width:100%;">
</div>
<div class="item">
<img src="images/Cimg4.jpg" alt="New york" style="width:100%;">
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
答案 0 :(得分:0)
在头部使用viewport
然后检查。
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">