【问题标题】:Bootstrap - Image not wrapping around text when columns collapseBootstrap - 列折叠时图像不环绕文本
【发布时间】:2015-12-08 03:34:54
【问题描述】:

当屏幕在 Twitter-Bootstrap 3 中缩小到小和超小时,我遇到了右侧图像换行的问题。对于中型和大型显示器,它仍然在右侧。第一行是左侧的图像,右侧的文本仍然包裹图像,因为它在所有屏幕尺寸上都可以折叠并且工作正常 - 没有问题。我希望下面显示的第二行让文本在所有显示尺寸上都像第一行一样环绕在图像周围。你能帮我吗?我将不胜感激。

    <div class="row">
       <div class="col-md-3 col-md-offset-1">
        <img src="images/my-image-on-the-left.jpg" alt="my image" width="219" height="148" align="left" />
       </div>  <!--col -->
        <div class="col-md-6"><p><br /> Text goes here and wraps around the image on left no problem</p>
         </div>  <!--col -->
     </div> <!-- row -->
  <br />
   <div class="row">
      <div class="col-md-6 col-md-offset-1">
     <p> Text goes here but only wraps around the image on the right on medium and large displays</p>
      </div><!--col -->
     <div class="col-md-3"> <img src="images/my-image-on-right.jpg" alt="image-right" width="246" height="259" align="right" /> </div><!--col --> 
   </div><!-- row -->

【问题讨论】:

  • 编辑您的问题以包含 jsFiddle 版本

标签: html css twitter-bootstrap-3


【解决方案1】:

为 xs 设备添加媒体查询,并浮动图像,以便文本在移动设备上换行。

@media (max-width: 768px) {
        .row img{
            float:left;
            margin:10px 0 10px 10px;
        }
    }

【讨论】:

  • 谢谢,但它不会影响静止图像换行的正确图像。澄清一下,左边的图像工作正常,我刚刚提供了它作为左边图像如何工作的示例。如果我造成混乱,我深表歉意,但我只需要右侧图像(第二“行”)的帮助。
猜你喜欢
  • 2018-07-20
  • 1970-01-01
  • 1970-01-01
  • 2022-06-29
  • 2019-09-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-02-07
相关资源
最近更新 更多