css – 在bootstrap 3上的图像周围换行文本

前端之家收集整理的这篇文章主要介绍了css – 在bootstrap 3上的图像周围换行文本前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我遇到了一个问题,即在我的列上将图像包裹在我的图像周围.
我有一个模板,它正在运行多个页面.一些图像不够长,所以它不能覆盖整个列…
我意识到他们有2个不同的div,但如果有人有解决方案请告诉我.

如果您阅读并查看问题所在,您会发现它不是重复的……

这是我的代码的样子

<div class="row" data-sf-element="Row">
  <div id="contentPlaceholder_C002_Col00" class="sf_colsIn col-md-6" data-sf-element="Column 1">
    <div>
      <div>
        <h2>Contrary to popular belief,Lorem Ipsum is not simply r</h2>
        <p>Contrary to popular belief,Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC,making it over 2000 years old. Richard McClintock,a Latin professor at Hampden-Sydney College in Virginia,looked up one of the more obscure Latin words,consectetur,from a Lorem Ipsum passage,and going through the cites of the word in classical literature,discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero,written in 45 BC. This book is a treatise on the theory of ethics,very popular during th</p>
        <p>Contrary to popular belief,very popular during th</p>
      </div>
    </div>
  </div>
  <div id="contentPlaceholder_C002_Col01" class="col-md-6" data-sf-element="Column 2"> <img src="/images/default-source/careers/careers_1.jpg?sfvrsn=2" title="careers_1" alt="careers_1"> </div>
</div>

解决方法

使用2列时,文本永远不会缠绕在图像上.

您应该将图像和文本放在一列中,然后将其填满.然后将文本和图像包装在div中并将它们浮动到左侧.这一行(代码是一个例子,未经过测试):

<div class="col-md-12">
   <div class="pull-left"><img src="YourImage.png"/></div>
   <div class="pull-left">Your text goes here......</div>
</div>

您可能需要在图像上留出一些余量,以使文本不会贴近图像

猜你在找的CSS相关文章