我在Bootstrap(3.3.7)中有一个响应式图像:
<div class="col-sm-2 text-center">
<img class="img-responsive center-block " src="img/1.png" style="max-width:
<p>Some guarantee text here</p>
</div>
看起来像这样:
如何让它显示在较小屏幕的文本旁边?基本上这个:
我明白img-responsive
添加display: block
,所以我尝试用内联样式覆盖它,但它没有用。
你可以通过使用float:left;
从here阅读更多内容来做到这一点
<div class="col-sm-2 text-center" >
<img class="img-responsive center-block" src="https://i.stack.imgur.com/R7CuQ.jpg" style="float:left;margin:4px; width: 120px;">
<p>Some guarantee text here</p>
<p>Some sdasd</p>
</div>