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

时间:2016-12-30 14:49:19

标签: 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>
&#13;
&#13;
&#13;

更新

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

1 个答案:

答案 0 :(得分:1)

在代码片段中看起来很好,也许你在达到它的col-sm- *破坏点之前正在检查?

.col-sm-*断点后:

enter image description here

.col-sm-*断点之前:

enter image description here