我在专栏上将文字包裹在图片周围时遇到了一个问题。
我有一个模板,它正在运行多个页面。有些图像不够长,因此无法覆盖整个列...
我意识到它们位于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, 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>
      </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中,然后将它们 float 到左侧。此行中的内容(代码是示例,未经测试):

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

您可能需要在图像上留出一定的页边距,以使文本不会粘在图像上

10-07 21:42