bootstrap模态框如何加滚动条


本文摘自PHP中文网,作者爱喝马黛茶的安东尼,侵删。

在html文件的<style></style>标签中加上如下代码:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

.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;

       }

然后再打开模态框,可以看到,滚动条已经出现了。

阅读剩余部分

相关阅读 >>

bootstrap2和3的区别是什么

vue能用bootstrap

浅谈bootstrap中的close类--关闭按钮

bootstrap如何给div设置边框颜色

bootstrap有什么优势

bootstrap.js有什么用

使用bootstrap有什么好处

bootstrap如何获取行数据?

浅谈css grid比bootstrap更适合创建布局的原因

bootstrap有必要学吗

更多相关阅读请进入《bootstrap》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...