【问题标题】:Displaying images on one line with BS3用 BS3 在一行上显示图像
【发布时间】:2014-01-29 14:53:39
【问题描述】:

您好,我是 bootstrap 新手,我想在一行中显示这些图像。代码如下:

<div class="container">
  <div class="row">
        <div class="col-lg-12 col-md-12 col-sm-12">
    <div class="col-lg-3 col-md-3 col-sm-3">
      <img src="img/LOGO2.jpg">
    </div>
    <div class="col-lg-6 col-md-6 col-sm-6">
      <img src="img/w.jpg">
    </div>
    <div class="col-lg-3 col-md-3 col-sm-3">
        <img src="img/f.jpg">
        <img src="img/y.jpg">
    </div>
  </div>
  </div>

我做错了什么?

【问题讨论】:

  • 尝试在两张图片上设置浮动。
  • 只有中间的图片后退,facebook和youtube的两张图片留在下线。
  • 我想我没理解对。如果您希望将所有四个图像放在一行中,请将其添加到您的 css 文件中。 '.row div div{float:left;}'
  • 它们确实显示在一行上:bootply.com/109175

标签: html css twitter-bootstrap twitter-bootstrap-3


【解决方案1】:

如果您在小窗口(例如移动设备)上查看文档,则图像会下拉,并且不会出现在同一行。

为超小型设备的 div 元素添加另一个前缀类.col-xs

  • .col-xs-* 超小型设备 (
  • .col-sm-*小型设备平板电脑(≥768px)
  • .col-md-* 中型设备台式机(≥992px)
  • .col-lg-*大型设备桌面(≥1200px)

例子

http://jsfiddle.net/e9yN5/

【讨论】:

    猜你喜欢
    • 2016-04-11
    • 1970-01-01
    • 2014-01-03
    • 1970-01-01
    • 1970-01-01
    • 2014-05-28
    • 2014-02-12
    • 1970-01-01
    相关资源
    最近更新 更多