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

问题描述 投票:0回答:1

我在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,所以我尝试用内联样式覆盖它,但它没有用。

css twitter-bootstrap layout
1个回答
0
投票

你可以通过使用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>
© www.soinside.com 2019 - 2024. All rights reserved.