【发布时间】:2014-04-20 22:08:52
【问题描述】:
我无法让我的引导轮播在移动设备和桌面屏幕上以不同方式显示。
这是我的 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>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<center><img src="img.jpg" alt="..."></center>
<div class="carousel-caption">
<p>1st Screen</p>
</div>
</div>
<div class="item">
<center> <img src="img2.jpg" alt="..."></center>
<div class="carousel-caption">
<p>2nd Screen</p>
</div>
</div>
<div class="item">
<center><img src="img3.jpg" alt="..."></center>
<div class="carousel-caption">
<p>3rd Screen</p>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
您可以查看网站here
我遇到的问题是我的图像尺寸在移动设备上显示不同,我拥有的 3 张图像是:
img.jpg 尺寸 = 700 x 378 pixels
img2.jpg 尺寸 = 700 x 378 pixels
img3.jpg 尺寸 = 700 x 378 pixels
图像在桌面设备上显示良好,但在移动设备上,整个图像似乎放大了,并且一些图像离开了屏幕。
我想要一个媒体查询,它只在移动设备上生成所有图像width:100%。
或者是否有一种简单的方法可以在所有设备上保留图像的大小?
感谢帮助
【问题讨论】:
标签: html css twitter-bootstrap media-queries