【问题标题】:How could i get this grid with Boostrap?我怎么能用 Bootstrap 得到这个网格?
【发布时间】:2015-05-11 03:59:01
【问题描述】:

我想要的是使用 Bootstrap 和 AngularJS 进行这种划分

我不知道如何进行划分,我想将容器分成 3 列,每列 4。还想知道我是否可以将容器分成两列,每列 6 列并重叠另一个 div制作第 3 区?

这是我之前说过的,但这并没有给我想要的。

<div class="container" contenteditable="false">
    <div class="col-md-6 text-center">
        <button class="btn btn-default">Button</button>
    </div>
    <div class="col-md-6 text-center">
        <button class="btn btn-default">Button</button>
    </div>
</div>

编辑 1

还想知道如何在智能手机上加载网站时获得这种响应。

【问题讨论】:

    标签: html angularjs twitter-bootstrap-3 angular-ui-bootstrap


    【解决方案1】:

    Plunker

    HTML:

    <div class="container">
      <div class="content">
        <div class="content-body">
          <div class="section1 pull-left">section 1</div>
          <div class="section2 pull-right">section 2</div>
          <div class="section3">section 3</div>
        </div>
      </div>
    </div>
    

    CSS:

    /* Reset */
    html, body { height: 100%; margin: 0; padding: 0; }
    
    
    .container { 
      display: table; 
      width: 100%; 
      height: 100%; 
    }
    
    .content { 
      display: table-row; 
      height: 100%; 
    }
    
    .content-body { 
      display: table-cell; 
    }
    
    .section1 {
      width: 50%;
      background: red;
      height: 100%;
      display:block;
    }
    
    .section2 {
      width: 50%;
      height: 50%;
      height: 100%;
      display: block;
      background: blue;
    }
    
    .section3 {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      margin: 0 auto;
      height: 50%;
      width: 50%;
      background: yellow;
    }
    

    对于响应式样式更改,您需要添加媒体查询:

    @media (max-width: 768px) {
            .section3, .section2, .section1 {
                display:block;
                position: relative;
    
            }
            .section3 {
                height: 10%;
                width: 100%
            }
            .section2 {
                height:60%;
                width: 100%
            }
            .section1 {
                height: 30%;
                width: 100%
            }
    
        }
    

    【讨论】:

    • 非常感谢,我对原始帖子进行了编辑,我也想让它响应。如果您能帮助我,我会将您的答案设置为正确答案:D
    猜你喜欢
    • 2018-10-15
    • 2022-12-17
    • 1970-01-01
    • 2022-01-06
    • 1970-01-01
    • 2018-02-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多