html - Bootstrap 网格的问题

标签 html css twitter-bootstrap

我的页面在电脑上看起来像这样:

enter image description here

而且我不会在移动尺寸上变成这样:

enter image description here

这有可能解决吗?

最佳答案

参见此处:http://getbootstrap.com/css/#grid-example-mixed

<!-- Stack the columns on mobile by making one full-width and the other half-width -->
<div class="row">
  <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>

<!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop -->
<div class="row">
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>

<!-- Columns are always 50% wide, on mobile and desktop -->
<div class="row">
  <div class="col-xs-6">.col-xs-6</div>
  <div class="col-xs-6">.col-xs-6</div>
</div>

以上是阅读的地方。

这就是我会做的: 我会先制作 2 列,在第一列中我会在彼此的顶部添加两个 div。

我在每个 div 中都使用了 style="" 来向您清楚地显示添加的 CSS

http://jsfiddle.net/Preben/gmvuv8L0/

<div class="row">
      <div class="col-xs-6" style="min-height:300px;">
         <div style="width:100%;margin-bottom:20px;background:#cecece;min-height:180px;">content</div>
         <div style="width:100%;background:#cecece;min-height:100px;">content</div>
      </div>
      <div class="col-xs-6" style="background:#cecece;min-height:300px;">Column # 2</div>
</div>

enter image description here

enter image description here

关于html - Bootstrap 网格的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28108354/

相关文章:

html - 页脚无法在 html 中正确显示

html - Qt 创建左箭头样式的按钮

html - 我可以在宽度和高度为 0 的 div 上有一个圆框阴影吗

css - 如何使用 Bootstrap 垂直对齐面板标题中的标签和文本框

javascript - 调整窗口大小时轮播不工作

javascript - 如何在具有路线提供商的应用程序中调用模态服务?

twitter-bootstrap - 宽度属性在 css3 中不起作用

css - Bootstrap 导航栏从左到右

HTML输入范围 slider 停止滑动时调用函数

css - + 选择器 ("sibling") 在 sass 中