如何限制Bootsrap面板的尺寸?

时间:2016-02-15 05:24:27

标签: css twitter-bootstrap

您好我想使用引导程序面板创建仪表板。

现在我希望面板大小相等,如果数据更多,那么我想自动设置溢出滚动。我想在每行中有三个大小相等的pannel,我将从中获取数据库

我这样做但没有奏效:

<div class="col-md-4">
      <div class="col-md-12">
        <div class="panel panel-success">
            <div class="panel-heading">
              <h2 class="panel-title">Last 10 Inserted Users</h2>
            </div>
             <div class="panel-body" style="overflow:hidden;">        


             My PHP code to fetch data which maybe small or large

            </div>
        </div>
      </div>
    </div>

2 个答案:

答案 0 :(得分:2)

下面提到的css将修复你有内容的div的高度:

.panel-body {
  height:300px;//change it to your desired height
  overflow-y: scroll;//will apply scroll on the vertical axis when your content goes beyond 300px
}

答案 1 :(得分:0)

  

对于面板尺寸限制您可以像这样编码..

<div class="panel panel-primary">
<div class="panel-heading">Heading</div>
<div class="panel-body" style="min-height: 10; max-height: 10;">Body</div>
</div>