Bootstrap中的响应滚动帧



我有一个当前响应的文本体。

<div class = "col-sm-6 col-xs-6>
  <div class = "well">
    <p> A lot of text... </p>
  </div>
</div>

我希望文本可以滚动(在井内),但我希望井的最大高度根据屏幕大小而改变。

以下内容使井可以滚动,但我不确定如何滚动拥有定制的高度。。。一个用于sm,一个用于xs。

.scroll_for_sm {
  height: 500px !important;
  overflow: scroll;
}

.scroll_for_xs {
  height: 250px !important;
  overflow: scroll;
}

如果你想让井的高度根据屏幕大小(或者这个问题中的高度)做出响应,只需指定你身体的高度,那么在css中添加这个:

html, body {
    height:100%;
    min-height: 100% !important;
}

然后,对于井,添加以下css:

.well{
    height:100%;
}

(百分比可以更改为像素、em、%等,并根据您的需要进行相应的取值)

最新更新