Bootstrap 模态框如何加滚动条? 下面本篇文章给大家介绍一下给 Bootstrap 的模态框加上垂直滚动条的方法. 有一定的参考价值, 有需要的朋友可以参考一下, 希望对大家有所帮助.
给 Bootstrap 的模态框加上垂直滚动条
在 html 文件的 < style></style > 标签中加上如下代码:
- .modal-dialog {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- }
- .modal-content {
- /*overflow-y: scroll; */
- position: absolute;
- top: 0;
- bottom: 0;
- width: 100%;
- }
- .modal-body {
- overflow-y: scroll;
- position: absolute;
- top: 55px;
- bottom: 65px;
- width: 100%;
- }
- .modal-header .close {margin-right: 15px;}
- .modal-footer {
- position: absolute;
- width: 100%;
- bottom: 0;
- }
然后在打开模态框, 可以看到, 滚动条已经出现了
如下图:
更多 web 前端 https://www.html.cn/ 知识, 请查阅 HTML 中文网 !!
来源: http://www.css88.com/framework/bootstrap/18233.html