html - 代码未堆叠在 col-sm-12 中

标签 html css twitter-bootstrap

当 col-sm 激活时,它应该像这样堆叠:

[ img ]

[ content ]

[ img ]

[ content ]

但是它像这样堆叠:

[ img ] [ content ]

[ img ] [ content ]

我已经尝试删除我的类以查看它是否会影响任何东西但没有任何变化。那我怎么做错了?这是我的 HTML 代码:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="homeContent">
  <div class="row homeContent-block">
    <div class="homeContent-block-image col-md-5 pull-left col-sm-12 hidden-xs">
      <img src="../../Content/images/w_city.jpg" alt="city pic" />
    </div>
    <div class="homeContent-block-image col-md-7 col-sm-12">
      <div class="homeContent-block-content-sub">
        <h1>This is a title.</h1>
        <p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
      </div>
    </div>
  </div>
  <div class="row homeContent-block">
    <div class="homeContent-block-image col-md-5 col-md-push-7 col-sm-12 hidden-xs">
      <img src="../../Content/images/w_city.jpg" alt="city pic" />
    </div>
    <div class="homeContent-block-image col-md-7 col-md-pull-5 col-sm-12">
      <div class="homeContent-block-content-sub">
        <h1>This is a title.</h1>
        <p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
      </div>
    </div>
  </div>
</div>


更新

我意识到我输入的是 col-s-12 而不是 col-sm-12。但是,我更改了它,但它仍然无法正常工作。

最佳答案

在代码片段上看起来不错,也许您在达到它的 col-sm-* 断点之前正在检查?

.col-sm-*断点之后:

enter image description here

.col-sm-*断点前:

enter image description here

关于html - 代码未堆叠在 col-sm-12 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41398121/

相关文章:

javascript - JSON + jQuery 不工作

javascript - cache.addAll 可以接受通配符匹配吗?

php - 帮助 Wordpress 站点自定义 'Featured Img Size' & 'Non-Featured'

css - Webfont 大小和内存问题

javascript - 在右栏中显示信息

javascript - 我如何给这个元素惯性/动量?

html - 在div内包装没有空格的长文本

html - 如何使用 CSS 正确定位嵌套元素?

javascript - 使用 jQuery 选择组中的多个复选框

css - Bootstrap 选项卡内容上的边框