【问题标题】:bootstrap column gets enlarged by an image引导列被图像放大
【发布时间】:2016-09-25 19:41:14
【问题描述】:

我有一个row,其中包含一些col-md。在最后一列中,我有一张图片,当在手机上渲染网站时,最后一列被图片放大并移动到一个新行中。

玉:

div.row#contact
   div.col-md-3
   div.col-md-2
   div.col-md-1
   div.col-md-1
   div.col-md-1
   div.col-md-1      
   div.col-md-3
     img(src = "./images/wko_logo.svg", alt = "wko logo")

scss:

img {
        max-width: 100%;
        height: auto;
    }

【问题讨论】:

    标签: twitter-bootstrap responsive-design pug responsive


    【解决方案1】:

    Bootstrap 的网格系统使用 sm 列,直到容器宽度降至 768 像素以下,如 https://getbootstrap.com/css/#grid-options 中定义的那样。当它低于该宽度时,它将为每个 .col-sm-* div 提供 100% 的宽度。给你的 html 元素一个 xs 容器宽度的行为,你的问题就解决了。

    可以在https://jsfiddle.net/fqxg3L9p/ 找到一个工作示例。

    【讨论】:

      猜你喜欢
      • 2019-06-07
      • 1970-01-01
      • 2017-03-24
      • 2019-02-16
      • 2016-01-12
      • 1970-01-01
      • 2019-06-21
      • 2014-12-25
      • 2014-08-09
      相关资源
      最近更新 更多