html - Bootstrap - 当列折叠时图像不环绕文本

标签 html css twitter-bootstrap-3

我遇到一个问题,当屏幕在 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 -->

最佳答案

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

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

关于html - Bootstrap - 当列折叠时图像不环绕文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34141544/

相关文章:

html和css网页内容调整大小

jquery - 如何让内容占据100%的高度和宽度

c# - 如何在使用 aspose.html 生成的 pdf 中添加页码

javascript - Jquery: fadeIn() a div in rows of divs: Visible divs should be pushed to the right.

html - 如何更改 asp.net-core mvc 示例页面中的字体颜色

javascript - 在 HTML 页面中显示和设置 HTML 源代码的样式

javascript - 如何动态更改 span 标签的颜色?

javascript - 无需javascript处理即可获取原始dom元素innerHTML

css - Bootstrap 添加容器类会破坏导航

javascript - 如何将 TinyMCE 保存为文件?