我在缩放带有透明背景的png图像时遇到了问题,其宽度为279像素,高度为432像素,在bootstrap3上具有类img响应。
问题:
无论何时,我都会在img标签中上传png图像,并使用class= "img-fluid“,它与我缩放的大小相同。其他图片似乎工作良好,但如果我试图上传一个更大的图像,它将成为反应,但只是规模从非常大到正常大小,而不是从正常到小。
我的问题是
用img响应类优化PNG映像的最佳方法是什么?
HTML:
<div class="poster">
<div class="container">
<div class="intro-text">
<div class="intro-heading">Welcome <img href="../html/indexfinal.html" class="bigv" src="../images/logos/bigvlogo.png" alt=""/> <img href="../html/indexfinal.html" class="midv" src="../images/logos/midvlogo.png" alt=""/> </div>
<div class="intro-lead-in">Hi yall'</div>
<div class="container-fluid">
<img class="mascot" src="../images/mascot/wave.png">
</div>
<a style="float:left" id="guestsignup"></a>
</div>
</div>
</div>发布于 2016-02-04 15:13:44
看起来不错。
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-md-6">
<img src="http://farm5.static.flickr.com/4017/4717107886_dcc1270a65_b.jpg" class="img-responsive" alt="Cinque Terre">
</div>
</div>
</div>
调整屏幕大小以查看差异。
发布于 2016-02-04 16:09:22
可以将img-responsive类添加到现有代码中:
<img class="mascot img-responsive" src="http://farm5.static.flickr.com/4017/4717107886_dcc1270a65_b.jpg">希望这就是你要找的。
https://stackoverflow.com/questions/35204418
复制相似问题