在较小屏幕的文本旁边制作响应式图像

时间:2017-12-31 17:29:10

标签: css twitter-bootstrap layout

我在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>

看起来像这样:

enter image description here

如何让它显示在较小屏幕的文本旁边?基本上就是这样:

enter image description here

我理解img-responsive添加了display: block,所以我尝试使用内联样式覆盖它,但它没有用。

1 个答案:

答案 0 :(得分:0)

哟可以使用float:left;here

中了解更多信息

&#13;
&#13;
 <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>
&#13;
&#13;
&#13;

相关问题